Use img.width instead of img[0]; same for hight.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 5 Jun 2019 04:12:25 +0000 (06:12 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 5 Jun 2019 04:12:25 +0000 (06:12 +0200)
test_gimp_passport.py

index 0fd532d..2893e44 100644 (file)
@@ -25,7 +25,7 @@ class TestMakePassport(unittest.TestCase):
         img = Image.new('RGB', (mm_to_pixel(35, dpi), mm_to_pixel(45, dpi)), 'lightgray')
         img.info['dpi'] = (dpi, dpi)
         draw = ImageDraw.ImageDraw(img)
-        draw.rectangle((0, 0, img.size[0]-1, img.size[1]-1), outline='black')
+        draw.rectangle((0, 0, img.width, img.height-1), outline='black')
         paper = tile(img, 150, 100, 4)
         self.assertIsInstance(paper, Image.Image)