From 9286c9e460c241cc45c479678c4bf45a5116296f Mon Sep 17 00:00:00 2001 From: wiredfool Date: Mon, 14 Sep 2015 05:10:27 -0700 Subject: [PATCH] Reenabling and fixing the former test_xyres_tiff test for integer resolutions --- Tests/test_file_tiff.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 57adcdd18..f8ce199da 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -85,12 +85,16 @@ class TestFileTiff(PillowTestCase): self.assertEqual(im.info['dpi'], (72., 72.)) - def xtest_int_resolution(self): + def test_int_resolution(self): + from PIL.TiffImagePlugin import X_RESOLUTION, Y_RESOLUTION + filename = "Tests/images/pil168.tif" + im = Image.open(filename) + # Try to read a file where X,Y_RESOLUTION are ints - im.tag[X_RESOLUTION] = (72,) - im.tag[Y_RESOLUTION] = (72,) + im.tag_v2[X_RESOLUTION] = 71 + im.tag_v2[Y_RESOLUTION] = 71 im._setup() - self.assertEqual(im.info['dpi'], (72., 72.)) + self.assertEqual(im.info['dpi'], (71., 71.)) def test_invalid_file(self): invalid_file = "Tests/images/flower.jpg"