{"action":"created","issue":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/2043","repository_url":"https://api.github.com/repos/python-pillow/Pillow","labels_url":"https://api.github.com/repos/python-pillow/Pillow/issues/2043/labels{/name}","comments_url":"https://api.github.com/repos/python-pillow/Pillow/issues/2043/comments","events_url":"https://api.github.com/repos/python-pillow/Pillow/issues/2043/events","html_url":"https://github.com/python-pillow/Pillow/issues/2043","id":168080745,"number":2043,"title":"SyntaxError: not a TIFF IFD - Is this expected?","user":{"login":"jplehmann","id":460964,"avatar_url":"https://avatars.githubusercontent.com/u/460964?v=3","gravatar_id":"","url":"https://api.github.com/users/jplehmann","html_url":"https://github.com/jplehmann","followers_url":"https://api.github.com/users/jplehmann/followers","following_url":"https://api.github.com/users/jplehmann/following{/other_user}","gists_url":"https://api.github.com/users/jplehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/jplehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jplehmann/subscriptions","organizations_url":"https://api.github.com/users/jplehmann/orgs","repos_url":"https://api.github.com/users/jplehmann/repos","events_url":"https://api.github.com/users/jplehmann/events{/privacy}","received_events_url":"https://api.github.com/users/jplehmann/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-28T12:11:09Z","updated_at":"2016-07-28T14:09:18Z","closed_at":"2016-07-28T14:09:18Z","body":"### What did you do?\r\n\r\nUsing sorl.thumbnail to generate a thumbnail, which uses Pillow backend for obtaining the EXIF info to determine orientation. \r\n\r\n### What did you expect to happen?\r\n\r\nTo get EXIF info with no errors.\r\n\r\n### What actually happened?\r\n\r\n```\r\n  File \"/Users/john/.venv/mm/lib/python2.7/site-packages/sorl/thumbnail/base.py\", line 157, in _create_thumbnail\r\n    image = default.engine.create(source_image, geometry, options)\r\n  File \"/Users/john/.venv/mm/lib/python2.7/site-packages/sorl/thumbnail/engines/base.py\", line 20, in create\r\n    image = self.orientation(image, geometry, options)\r\n  File \"/Users/john/.venv/mm/lib/python2.7/site-packages/sorl/thumbnail/engines/base.py\", line 45, in orientation\r\n    return self._orientation(image)\r\n  File \"/Users/john/.venv/mm/lib/python2.7/site-packages/sorl/thumbnail/engines/pil_engine.py\", line 71, in _orientation\r\n    exif = image._getexif()\r\n  File \"/Users/john/.venv/mm/lib/python2.7/site-packages/PIL/JpegImagePlugin.py\", line 390, in _getexif\r\n    return _getexif(self)\r\n  File \"/Users/john/.venv/mm/lib/python2.7/site-packages/PIL/JpegImagePlugin.py\", line 418, in _getexif\r\n    info = TiffImagePlugin.ImageFileDirectory(head)\r\n  File \"/Users/john/.venv/mm/lib/python2.7/site-packages/PIL/TiffImagePlugin.py\", line 274, in __init__\r\n    raise SyntaxError(\"not a TIFF IFD\")\r\nSyntaxError: not a TIFF IFD\r\n```\r\n### What versions of Pillow and Python are you using?\r\n\r\nPillow==2.6.1\r\nPython 2.7.10\r\n\r\nPlease include code that reproduces the issue and whenever possible, an image that demonstrates the issue. The best reproductions are self-contained scripts with minimal dependencies.\r\n\r\n```\r\ni = Image.open(\"...\")\r\ni._getexif()\r\n```\r\n\r\nI'm attaching the image causing the problem.  \r\n\r\n![20160707034802-20160628_174527_wm](https://cloud.githubusercontent.com/assets/460964/17211874/6767818c-5491-11e6-9c8d-584c2f608dd0.jpg)\r\n\r\nNote that this image has a watermark applied.  I had no problems with the image BEFORE the watermark was applied so clearly that's doing something bad/unsupported.\r\n\r\nWhen I use `mdls` to view the EXIF info all looks well to me.  It dumps lots of metadata including orientation to the console.\r\n\r\nBottom line, I don't know if Pillow should support this image's EXIF info or if the image is sort-of corrupt.  Thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/comments/235905356","html_url":"https://github.com/python-pillow/Pillow/issues/2043#issuecomment-235905356","issue_url":"https://api.github.com/repos/python-pillow/Pillow/issues/2043","id":235905356,"user":{"login":"jplehmann","id":460964,"avatar_url":"https://avatars.githubusercontent.com/u/460964?v=3","gravatar_id":"","url":"https://api.github.com/users/jplehmann","html_url":"https://github.com/jplehmann","followers_url":"https://api.github.com/users/jplehmann/followers","following_url":"https://api.github.com/users/jplehmann/following{/other_user}","gists_url":"https://api.github.com/users/jplehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/jplehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jplehmann/subscriptions","organizations_url":"https://api.github.com/users/jplehmann/orgs","repos_url":"https://api.github.com/users/jplehmann/repos","events_url":"https://api.github.com/users/jplehmann/events{/privacy}","received_events_url":"https://api.github.com/users/jplehmann/received_events","type":"User","site_admin":false},"created_at":"2016-07-28T14:09:18Z","updated_at":"2016-07-28T14:09:18Z","body":"Thank you for your speedy response. I will find out what is generating the watermark and report the bug.  I'll report back if they have some kind of argument."}}
{"actor":{"display_login":"jplehmann"}}