{"action":"created","issue":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/1428","labels_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1428/labels{/name}","comments_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1428/comments","events_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1428/events","html_url":"https://github.com/python-pillow/Pillow/pull/1428","id":106627384,"number":1428,"title":"Load broken images","user":{"login":"homm","id":128982,"avatar_url":"https://avatars.githubusercontent.com/u/128982?v=3","gravatar_id":"","url":"https://api.github.com/users/homm","html_url":"https://github.com/homm","followers_url":"https://api.github.com/users/homm/followers","following_url":"https://api.github.com/users/homm/following{/other_user}","gists_url":"https://api.github.com/users/homm/gists{/gist_id}","starred_url":"https://api.github.com/users/homm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/homm/subscriptions","organizations_url":"https://api.github.com/users/homm/orgs","repos_url":"https://api.github.com/users/homm/repos","events_url":"https://api.github.com/users/homm/events{/privacy}","received_events_url":"https://api.github.com/users/homm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-15T19:24:40Z","updated_at":"2015-09-18T10:33:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/python-pillow/Pillow/pulls/1428","html_url":"https://github.com/python-pillow/Pillow/pull/1428","diff_url":"https://github.com/python-pillow/Pillow/pull/1428.diff","patch_url":"https://github.com/python-pillow/Pillow/pull/1428.patch"},"body":"This PR revert change from #38. There was a couple of quick fixes and this change. As I know there was no discussion about this decision.\r\n\r\nLater @cezarsa try to create the option for loading broken images in #311. He said:\r\n\r\n> Because I'm not sure about what use cases @d-schmidt had in mind when the size check was added, I've introduced a new flag called IGNORE_DECODING_ERRORS that if True will never raise IOError. \r\n\r\nThe problem with not opened images was not confirmed and this changes was reverted.\r\n\r\n#### My point\r\n\r\n1. I don't see a big difference between \"truncated image\" and \"image with broken data stream\", at least for my tasks. I think what you may want to read original not corrupted image from a file (LOAD_TRUNCATED_IMAGES = False), or you may want to load as many data from an image as you can (LOAD_TRUNCATED_IMAGES = True). How exactly an image is corrupted (is it truncated or has broken datastream) does not matter for almost all tasks.\r\n\r\n2. As I understand Pillow currently loads broken images (not only truncated) if at least first chunk of the image was loaded correctly (n != 0).\r\n\r\n3. Corrupted first chunk does not mean what nothing was loaded. It can be corrupted in the middle or close to the end. I've attached the test image with corrupted first chunk but which reads for more than the half. Unfortunately, I don't know anything about its licence (and I just realized what we probably need to remove some of my previous added test images due to legal purposes :-).\r\n\r\n4. This can be confusing, but I also don't see a big problem even if nothing was loaded at all. This is just a special case of \"something was loaded\" in opposite to \"everything was loaded correctly\". I bet most of image viewers will show a black or transparent rectangle instead of some sort of error in this case."},"comment":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/comments/141414058","html_url":"https://github.com/python-pillow/Pillow/pull/1428#issuecomment-141414058","issue_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1428","id":141414058,"user":{"login":"homm","id":128982,"avatar_url":"https://avatars.githubusercontent.com/u/128982?v=3","gravatar_id":"","url":"https://api.github.com/users/homm","html_url":"https://github.com/homm","followers_url":"https://api.github.com/users/homm/followers","following_url":"https://api.github.com/users/homm/following{/other_user}","gists_url":"https://api.github.com/users/homm/gists{/gist_id}","starred_url":"https://api.github.com/users/homm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/homm/subscriptions","organizations_url":"https://api.github.com/users/homm/orgs","repos_url":"https://api.github.com/users/homm/repos","events_url":"https://api.github.com/users/homm/events{/privacy}","received_events_url":"https://api.github.com/users/homm/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T10:33:29Z","updated_at":"2015-09-18T10:33:29Z","body":"Any thoughts?\r\n\r\nFor being a part of 3.0.0, this should be in master for some time so everyone can confirm what this works for she. There only 12 days left until the release."}}