{"action":"opened","issue":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/2839","repository_url":"https://api.github.com/repos/python-pillow/Pillow","labels_url":"https://api.github.com/repos/python-pillow/Pillow/issues/2839/labels{/name}","comments_url":"https://api.github.com/repos/python-pillow/Pillow/issues/2839/comments","events_url":"https://api.github.com/repos/python-pillow/Pillow/issues/2839/events","html_url":"https://github.com/python-pillow/Pillow/issues/2839","id":271865574,"number":2839,"title":"TIFF that could not be loaded gets corrupted by Pillow 4.3.0","user":{"login":"giorgiosironi","id":160299,"avatar_url":"https://avatars3.githubusercontent.com/u/160299?v=4","gravatar_id":"","url":"https://api.github.com/users/giorgiosironi","html_url":"https://github.com/giorgiosironi","followers_url":"https://api.github.com/users/giorgiosironi/followers","following_url":"https://api.github.com/users/giorgiosironi/following{/other_user}","gists_url":"https://api.github.com/users/giorgiosironi/gists{/gist_id}","starred_url":"https://api.github.com/users/giorgiosironi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giorgiosironi/subscriptions","organizations_url":"https://api.github.com/users/giorgiosironi/orgs","repos_url":"https://api.github.com/users/giorgiosironi/repos","events_url":"https://api.github.com/users/giorgiosironi/events{/privacy}","received_events_url":"https://api.github.com/users/giorgiosironi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-07T15:10:28Z","updated_at":"2017-11-07T15:10:28Z","closed_at":null,"author_association":"NONE","body":"Pillow was refusing to open this TIFF in version 4.2.1. In version 4.3.0, it loads it, but then saving it in any format including TIFF produces a silent corruption. Python 2.7.14 in both cases.\r\n\r\nThis is the reproducing script:\r\n```\r\nfrom PIL import Image                                                                                                                      \r\n\r\n# https://s3-external-1.amazonaws.com/prod-elife-published/articles/32330/elife-32330-fig1-v1.tif \r\nsrc_fp = 'elife-32330-fig1-v1.tif'\r\nim = Image.open(src_fp)\r\ntarget_fp = open('result.tif', 'w')\r\nim.save(target_fp)\r\n```\r\n\r\nIn 4.2.1:\r\n```\r\n  File \"reproducing.py\", line 5, in <module>\r\n    im = Image.open(src_fp)\r\n  File \"/opt/loris/venv/local/lib/python2.7/site-packages/PIL/Image.py\", line 2519, in open\r\n    % (filename if filename else fp))\r\nIOError: cannot identify image file 'elife-32330-fig1-v1.tif'\r\n```\r\n\r\nIn 4.3.0, no output, file gets stored and corrupted.\r\n[elife-32330-fig1-v1.tif.gz](https://github.com/python-pillow/Pillow/files/1450479/elife-32330-fig1-v1.tif.gz)\r\n[result.tif.gz](https://github.com/python-pillow/Pillow/files/1450480/result.tif.gz)\r\n![converting to PNG](https://user-images.githubusercontent.com/160299/32500515-918e5826-c3cd-11e7-80c2-5995952cf130.png)\r\n\r\nI tried to track how the `Image` class changed from 4.2.1 to 4.3.0, but there were too many changes to identify the source. I don't expect it to start to work, but to continue throwing an exception if it can't be read safely.\r\n\r\n"}}
{"actor":{"display_login":"giorgiosironi"}}