{"action":"created","issue":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/1138","labels_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1138/labels{/name}","comments_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1138/comments","events_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1138/events","html_url":"https://github.com/python-pillow/Pillow/issues/1138","id":63129310,"number":1138,"title":"JPEG image being identified as MPO","user":{"login":"xtagon","id":47229,"avatar_url":"https://avatars.githubusercontent.com/u/47229?v=3","gravatar_id":"","url":"https://api.github.com/users/xtagon","html_url":"https://github.com/xtagon","followers_url":"https://api.github.com/users/xtagon/followers","following_url":"https://api.github.com/users/xtagon/following{/other_user}","gists_url":"https://api.github.com/users/xtagon/gists{/gist_id}","starred_url":"https://api.github.com/users/xtagon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xtagon/subscriptions","organizations_url":"https://api.github.com/users/xtagon/orgs","repos_url":"https://api.github.com/users/xtagon/repos","events_url":"https://api.github.com/users/xtagon/events{/privacy}","received_events_url":"https://api.github.com/users/xtagon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-03-20T01:01:14Z","updated_at":"2015-03-20T17:42:26Z","closed_at":null,"body":"Hi,\r\n\r\nWe're using [Pilbox](https://github.com/agschwender/pilbox) which depends on Pillow and performs image resizing as a service. A few of our images in production are failing because Pillow is returning the image format as MPO and not JPEG, so Pilbox throws an error because MPO is not a supported format.\r\n\r\nThe image identifies as a JPEG in ImageMagick, PhotoShop, etc. and opens fine in those programs as a JPEG. However, if we open the failing image in PhotoShop and save a new copy as a new JPEG file, the new image no longer reproduces the issue. Obviously there's something funky going on with the image file, but we can't identify what.\r\n\r\nHere is a minimal test case showing the issue:\r\n\r\nImage (should be JPEG, identifies as MPO): https://drive.google.com/file/d/0Bx-VFyfqu1DlaFlKVVk1ZDh6S2lPbGFwNUFlN3liQW1PRER3/view?usp=sharing\r\n\r\n```python\r\nimport sys\r\nimport PIL.Image\r\n\r\nimg = PIL.Image.open(sys.argv[1])\r\nprint(img.format)\r\n```\r\n\r\nSave the image to example.jpg and the python script to jpeg_mpo_test.py, and run:\r\n\r\n```\r\npython jpeg_mpo_test.py example.jpg\r\n```\r\n\r\nIt prints \"MPO\" and not \"JPEG\".\r\n\r\nWe'd really appreciate any help in figuring this out as we are depending on these libraries on some live apps. Let me know what other information you need. Thanks in advance!"},"comment":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/comments/84085278","html_url":"https://github.com/python-pillow/Pillow/issues/1138#issuecomment-84085278","issue_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1138","id":84085278,"user":{"login":"xtagon","id":47229,"avatar_url":"https://avatars.githubusercontent.com/u/47229?v=3","gravatar_id":"","url":"https://api.github.com/users/xtagon","html_url":"https://github.com/xtagon","followers_url":"https://api.github.com/users/xtagon/followers","following_url":"https://api.github.com/users/xtagon/following{/other_user}","gists_url":"https://api.github.com/users/xtagon/gists{/gist_id}","starred_url":"https://api.github.com/users/xtagon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xtagon/subscriptions","organizations_url":"https://api.github.com/users/xtagon/orgs","repos_url":"https://api.github.com/users/xtagon/repos","events_url":"https://api.github.com/users/xtagon/events{/privacy}","received_events_url":"https://api.github.com/users/xtagon/received_events","type":"User","site_admin":false},"created_at":"2015-03-20T17:42:26Z","updated_at":"2015-03-20T17:42:26Z","body":"So correct me if I'm wrong, an MPO is still a valid JPEG but with extra data (more image frames)? Perhaps Pillow could report the format as JPEG but set an extra flag that indicates that it's an MPO?"}}