当前位置: 首页>>代码示例>>Python>>正文


Python utils.getImageSize函数代码示例

本文整理汇总了Python中test.utils.getImageSize函数的典型用法代码示例。如果您正苦于以下问题:Python getImageSize函数的具体用法?Python getImageSize怎么用?Python getImageSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getImageSize函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testAddIcons_19_resize

    def testAddIcons_19_resize(self):
        files = ['16x16.png',
                 '16x15.png',
                 '16x17.png',
                 '15x16.png',
                 '17x16.png',
                 '17x17.png',
                 '15x15.png',
                 '8x8.png',
                 '8x16.png',
                 '16x8.png',
                 'first.png',
                 'first_vertical.png']

        fullPaths = [os.path.join(self.imagesDir, fname) for fname in files]

        os.mkdir(self.tempDir1)
        collection = IconsCollection(self.tempDir1)
        collection.addIcons(None, fullPaths)

        icons = sorted(collection.getIcons(None))
        self.assertEqual(len(icons), 12)

        icons = {fname: os.path.join(self.tempDir1, fname) for fname in files}

        for fname in files:
            self.assertEqual(getImageSize(icons[fname]), (16, 16))
开发者ID:Jenyay,项目名称:outwiker,代码行数:27,代码来源:test_iconscollection.py

示例2: testWxThumbWidthTiff

    def testWxThumbWidthTiff (self):
        self.fname_in = "../test/images/outwiker_1.1.0_02.tiff"
        self.fname_out = "../test/images/outwiker_1.1.0_02_th.png"

        if os.path.exists (self.fname_out):
            os.remove (self.fname_out)

        self.thumbmaker = WxThumbmaker()
        newwidth = 250
        newheight = 215

        self.thumbmaker.thumbByWidth (self.fname_in, newwidth, self.fname_out)
        (width, height) = getImageSize (self.fname_out)

        self.assertEqual (width, newwidth)
        self.assertEqual (height, newheight)

        if os.path.exists (self.fname_out):
            os.remove (self.fname_out)
开发者ID:qyqx,项目名称:outwiker,代码行数:19,代码来源:wxthumbmaker.py

示例3: testWxThumbWidthJpeg

    def testWxThumbWidthJpeg (self):
        self.fname_in = "../test/images/first.jpg"
        self.fname_out = "../test/images/first_th.jpg"

        if os.path.exists (self.fname_out):
            os.remove (self.fname_out)

        self.thumbmaker = WxThumbmaker()
        newwidth = 250
        newheight = 182

        self.thumbmaker.thumbByWidth (self.fname_in, newwidth, self.fname_out)
        (width, height) = getImageSize (self.fname_out)

        self.assertEqual (width, newwidth)
        self.assertEqual (height, newheight)

        if os.path.exists (self.fname_out):
            os.remove (self.fname_out)
开发者ID:qyqx,项目名称:outwiker,代码行数:19,代码来源:wxthumbmaker.py

示例4: testWxThumbHeightJpegPng

    def testWxThumbHeightJpegPng (self):
        self.fname_in = "../test/images/first.jpg"
        self.fname_out = "../test/images/first_th.png"

        if os.path.exists (self.fname_out):
            os.remove (self.fname_out)

        self.thumbmaker = ThumbmakerWx()
        newheight = 180
        newwidth = 246

        self.thumbmaker.thumbByHeight (self.fname_in, newheight, self.fname_out)
        (width, height) = getImageSize (self.fname_out)

        self.assertEqual (width, newwidth)
        self.assertEqual (height, newheight)

        if os.path.exists (self.fname_out):
            os.remove (self.fname_out)
开发者ID:LihMeh,项目名称:outwiker,代码行数:19,代码来源:thumbmakerwx.py

示例5: testWxThumbMaxSizeJpeg2

    def testWxThumbMaxSizeJpeg2 (self):
        self.fname_in = "../test/images/first_vertical.jpeg"
        self.fname_out = "../test/images/first_vertical_th.jpg"

        if os.path.exists (self.fname_out):
            os.remove (self.fname_out)

        self.thumbmaker = WxThumbmaker()
        newsize = 250

        newwidth = 182
        newheight = 250

        self.thumbmaker.thumbByMaxSize (self.fname_in, newsize, self.fname_out)
        (width, height) = getImageSize (self.fname_out)

        self.assertEqual (width, newwidth)
        self.assertEqual (height, newheight)

        if os.path.exists (self.fname_out):
            os.remove (self.fname_out)
开发者ID:qyqx,项目名称:outwiker,代码行数:21,代码来源:wxthumbmaker.py

示例6: testThumbByHeightJpeg

    def testThumbByHeightJpeg(self):
        images_dir = "../test/images"

        fname_in = "first.jpg"
        page = self.wikiroot["Страница 1"]

        Attachment(page).attach([os.path.join(images_dir, fname_in)])

        newwidth = 249
        newheight = 182

        thumb_fname = self.thumbmaker.createThumbByHeight(page,
                                                          fname_in,
                                                          newheight)
        thumb_path = os.path.join(page.path, thumb_fname)

        (width, height) = getImageSize(thumb_path)

        self.assertTrue(os.path.exists(thumb_path), thumb_path)
        self.assertEqual(width, newwidth)
        self.assertEqual(height, newheight)
开发者ID:Jenyay,项目名称:outwiker,代码行数:21,代码来源:test_pagethumbmaker.py

示例7: testThumbByWidthPng

    def testThumbByWidthPng(self):
        images_dir = "../test/images"

        fname_in = "outwiker_1.1.0_02.png"
        page = self.wikiroot["Страница 1"]

        Attachment(page).attach([os.path.join(images_dir, fname_in)])

        newwidth = 250
        newheight = 215

        thumb_fname = self.thumbmaker.createThumbByWidth(page,
                                                         fname_in,
                                                         newwidth)
        thumb_path = os.path.join(page.path, thumb_fname)

        (width, height) = getImageSize(thumb_path)

        self.assertTrue(os.path.exists(thumb_path), thumb_path)
        self.assertEqual(width, newwidth)
        self.assertEqual(height, newheight)
开发者ID:Jenyay,项目名称:outwiker,代码行数:21,代码来源:test_pagethumbmaker.py

示例8: testWxThumbMaxSize_08_png

    def testWxThumbMaxSize_08_png (self):
        self.fname_in = "../test/images/8x16.png"
        self.fname_out = "../test/images/_thumb.png"

        if os.path.exists (self.fname_out):
            os.remove (self.fname_out)

        self.thumbmaker = ThumbmakerPil()
        newsize = 16

        newwidth = 8
        newheight = 16

        self.thumbmaker.thumbByMaxSize (self.fname_in, newsize, self.fname_out, larger=False)
        (width, height) = getImageSize (self.fname_out)

        self.assertEqual (width, newwidth)
        self.assertEqual (height, newheight)

        if os.path.exists (self.fname_out):
            os.remove (self.fname_out)
开发者ID:Jenyay,项目名称:outwiker,代码行数:21,代码来源:test_thumbmakerpil.py

示例9: testThumbByMaxSizeJpeg2

    def testThumbByMaxSizeJpeg2(self):
        images_dir = "../test/images"

        fname_in = "first_vertical.jpeg"
        page = self.wikiroot["Страница 1"]

        Attachment(page).attach([os.path.join(images_dir, fname_in)])

        maxsize = 250

        newwidth = 182
        newheight = 250

        thumb_fname = self.thumbmaker.createThumbByMaxSize(page,
                                                           fname_in,
                                                           maxsize)
        thumb_path = os.path.join(page.path, thumb_fname)

        (width, height) = getImageSize(thumb_path)

        self.assertTrue(os.path.exists(thumb_path), thumb_path)
        self.assertEqual(width, newwidth)
        self.assertEqual(height, newheight)
开发者ID:Jenyay,项目名称:outwiker,代码行数:23,代码来源:test_pagethumbmaker.py

示例10: __getMaxImageSize

 def __getMaxImageSize(self, fname):
     (width, height) = getImageSize(fname)
     return max(width, height)
开发者ID:Jenyay,项目名称:outwiker,代码行数:3,代码来源:test_iconscollection.py


注:本文中的test.utils.getImageSize函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。