From ab569e61066e1ef4490db730ca13180afe18e461 Mon Sep 17 00:00:00 2001
From: Andrew Murray <radarhere@users.noreply.github.com>
Date: Sun, 29 Sep 2019 14:15:48 +1000
Subject: [PATCH] Raise error if dimension is a string

Signed-off-by: hanxinke <hanxinke@huawei.com>
---
 src/PIL/TiffImagePlugin.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py
index 5059a13..05f58e5 100644
--- a/src/PIL/TiffImagePlugin.py
+++ b/src/PIL/TiffImagePlugin.py
@@ -1185,8 +1185,8 @@ class TiffImageFile(ImageFile.ImageFile):
             print("- YCbCr subsampling:", self.tag.get(530))
 
         # size
-        xsize = self.tag_v2.get(IMAGEWIDTH)
-        ysize = self.tag_v2.get(IMAGELENGTH)
+        xsize = int(self.tag_v2.get(IMAGEWIDTH))
+        ysize = int(self.tag_v2.get(IMAGELENGTH))
         self._size = xsize, ysize
 
         if DEBUG:
-- 
2.19.1

