Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JPEGs recognised as MPOs #4603

Closed
JamesJGarner opened this issue May 2, 2020 · 6 comments
Closed

JPEGs recognised as MPOs #4603

JamesJGarner opened this issue May 2, 2020 · 6 comments

Comments

@JamesJGarner
Copy link

Unsure why issue #1198 was closed as it is still a bug, learned this the hard way when a user tried to upload a JPEG and Pillow mistook it for a MPO and exploded.

@radarhere
Copy link
Member

radarhere commented May 3, 2020

Hi. Could you give us a self-contained example, with an image? I'm interested in looking at your specific file, to be able to talk about whether it is truly an MPO or not, and It would be good to know exactly what is meant by 'exploded'.

Also, what Pillow version are you using?

@radarhere
Copy link
Member

Looking at the discussion in #1198, it seems to conclude that the image in question is actually an MPO.

@radarhere radarhere changed the title Issue #1198 is still broken JPEGs recognised as MPOs May 3, 2020
@JamesJGarner
Copy link
Author

JamesJGarner commented May 3, 2020 via email

@radarhere
Copy link
Member

radarhere commented May 3, 2020

As per a comment in #1198, if you run exiftool on 'bob 15.jpg', part of the results are

Number Of Images : 2
MP Image Flags : Dependent child image
MP Image Format : JPEG
MP Image Type : Large Thumbnail (full HD equivalent)
MP Image Length : 621306
MP Image Start : 4850597

You can read in the Multi-Picture format documentation about the 'Dependent child image' and 'Large Thumbnail' values.

If you feel that it should be a JPEG because the extension is '.jpg', the same documentation states that

To clarify the compatible range, a file consisting only of a main image and monitor display image (extension .JPG) is a Baseline MP file, while a file including other types (extension .MPO) is an Extended MP file.

Also, as a general rule, Pillow does not interpret images according to their file extensions. It reads the data and acts accordingly.

@radarhere
Copy link
Member

To be clear, when I talk about 'bob 15.jpg', that is the image from #1138

@radarhere
Copy link
Member

Closing, since all available information says that the relevant image is an MPO, and no argument has been presented otherwise. This can be re-opened if there is a discussion to be had, but at the moment there is nothing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants