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

MPO format loading error when EXIF data is present #5164

Closed
JackDesBwa opened this issue Dec 31, 2020 · 4 comments · Fixed by #5168
Closed

MPO format loading error when EXIF data is present #5164

JackDesBwa opened this issue Dec 31, 2020 · 4 comments · Fixed by #5168

Comments

@JackDesBwa
Copy link

Someone sent me a MPO file that I was not able to open with Pillow
It looks like the second image of the file has EXIF data that might conflict with the loading process.
In particular, the reported size does not correspond to the image, but I was not able to figure out if it is the root cause of the bug.

I created a similar image that you can use for your tests and publish if you need. I copied the EXIF of the original file with some subtractions such as the embedded thumbnail. It exhibits the same behavior and is correctly loaded by some other players, such as geeqie or sView.

In this ZIP (pillow_mpo_exif_error.zip), you will find the sample image and a script that show the error with this output: [visible with 8.0.1]

Image 0 size: (64, 64)
Image 0 loaded
Image 1 size: (5472, 3648)
Image 1 error: image file is truncated (0 bytes not processed)

As you can see, the second image is reported to be 5472×3648 but is actually 64×64 like the first one.

@radarhere radarhere changed the title MPO format loading error when EXIF data are present MPO format loading error when EXIF data is present Jan 1, 2021
@radarhere
Copy link
Member

Thanks very much for providing a test image. The incorrect reported size would be the cause, yes.

Here is a link to the specification - https://web.archive.org/web/20190227081740/http://www.cipa.jp/std/documents/e/DC-007_E.pdf.

I do think your image is just malformed. I've created PR #5168 as a possible solution though, where I posit that only 'Large Thumbnail' images can have frames of different sizes.

@JackDesBwa
Copy link
Author

The image that I received was created with the popular StereoPhotoMaker program.
It is possible that this case is badly managed in it. But then, there are many MPOs of this form in the wild that are perfectly read with several programs, including with the embedded software of 3D TV sets and the ones I cited before.

@radarhere
Copy link
Member

Are you able to upload the original image? I understand that you don't want it to be included in the test images, but it could be helpful to just verify that there isn't a 5472 by 3648 frame hiding in there.

@JackDesBwa
Copy link
Author

He did not explicitly give permission to share the image publicly, but he would certainly not be against using it for a private analysis.
One time download link: https://framadrop.org/lufi/r/jekSuYQL9n#GgTzjJq3uwZ8DRM8D5uXXW1NZY6/6XHwpfRBFpQrDQk=

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

Successfully merging a pull request may close this issue.

2 participants