示例#1
0
    def testResize(self):
        image = Image.open(self.jpgFn)
        image = image.crop((100, 100, 900, 900))

        image2 = Image.open(self.jpgFn)
        image2 = image.resize((800, 800), 'foo')

        self.assertEquals(image.size, image2.size)
示例#2
0
    def testSave(self):
        image = Image.open(self.jpgFn)
        image.save(self.pytofOutput, 92)

        image2 = Image.open(self.pytofOutput)
示例#3
0
    def testRotate(self):
        image = Image.open(self.jpgFn)
        rotatedImage = image.rotate(90)
        [x, y] = self.jpgSize

        self.assertEquals(rotatedImage.size, [y, x])
示例#4
0
 def testCrop(self):
     image = Image.open(self.jpgFn)
     image = image.crop((100, 100, 900, 900))
     self.assertEquals(image.size, [800, 800])
示例#5
0
 def testCreateObject(self):
     image = Image.open(self.jpgFn)
     self.assertEquals(image.size, self.jpgSize)