Пример #1
0
 def testImageCopy(self):
     it = ImageTransform.create(ImageTransform.STD, 100, 100);
     fp = FileProcess()
     info = fp.copyImage(fileInTestDir('img/test.jpg'), transform = it, short_dir = 'i') 
     self.assertEquals(info.is_image(), True)
     self.assertEquals(info.content_type, ImageInfo.JPEG)
     self.assert_(info.width <= 100)
     self.assert_(info.height <= 100) 
     split_p = info.short_path.split(os.path.sep)
     self.assert_('i' in split_p)
     self.assert_('img' in split_p)
     info = fp.copyImage(fileInTestDir('img/test.jpg')) 
     self.assertEquals(info.is_image(), True)
     self.assertEquals(info.content_type, ImageInfo.JPEG)
     self.assertEquals(info.width, 418)
     self.assertEquals(info.height, 604) 
Пример #2
0
 def testImageCopy(self):
     it = ImageTransform.create(ImageTransform.STD, 100, 100)
     fp = FileProcess()
     info = fp.copyImage(fileInTestDir('img/test.jpg'),
                         transform=it,
                         short_dir='i')
     self.assertEquals(info.is_image(), True)
     self.assertEquals(info.content_type, ImageInfo.JPEG)
     self.assert_(info.width <= 100)
     self.assert_(info.height <= 100)
     split_p = info.short_path.split(os.path.sep)
     self.assert_('i' in split_p)
     self.assert_('img' in split_p)
     info = fp.copyImage(fileInTestDir('img/test.jpg'))
     self.assertEquals(info.is_image(), True)
     self.assertEquals(info.content_type, ImageInfo.JPEG)
     self.assertEquals(info.width, 418)
     self.assertEquals(info.height, 604)
Пример #3
0
 def thumb_transform_image(self):
     return ImageTransform.create(self.transform_type,\
             width = self.max_thumb_width,\
             height = self.max_thumb_height)
Пример #4
0
 def thumb_transform_image(self):
     return ImageTransform.create(self.transform_type,\
             width = self.max_thumb_width,\
             height = self.max_thumb_height)