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

Some JPEGs are identified as MPOs #85

Closed
howff opened this issue Jan 3, 2021 · 2 comments · Fixed by #88
Closed

Some JPEGs are identified as MPOs #85

howff opened this issue Jan 3, 2021 · 2 comments · Fixed by #88

Comments

@howff
Copy link

howff commented Jan 3, 2021

Due to a "feature" of the Python imaging library Pillow/PIL some JPEGs are identified as MPO, i.e. when jpegcrop checks for image.format=="JPEG" it misses those JPEG images where image.format=="MPO".

python-pillow/Pillow#4603

MPO files are normal JPEG images but contain a tag which can contain other data which may be additional JPEG images, possibly stereoscopic or sometimes a larger thumbnail.

If the utilities which jpegcrop calls (exiftool, jpegtran) can handle MPO-style JPEG then jpegcrop can simply check for =="MPO" as well as =="JPEG". If there is a danger that the user will get unexpected behaviour (eg. a loss of valuable data) then a warning should be issued first.

In my case it's simply a regular JPEG from a Canon camera, I've no idea why it's MPO and not JPEG, so I just want it handled exactly the same as a JPEG.

@ConradHughes
Copy link
Collaborator

ConradHughes commented Apr 12, 2021

Hi howff, thanks a lot for this — and sorry for my slow response to your other issues — I've been wondering for a while why cropgui doesn't invoke jpegtran on some JPEGs, and I think you've just explained why. If you've a sample image that can reproduce this, I'd be very grateful — otherwise I'll have a search of recent images of my own when I get time.

(the bug report you link used to have a sample image, but no more..)

@howff
Copy link
Author

howff commented Apr 12, 2021

Did I not submit a PR to fix this? Sorry, I'll try and submit on ASAP

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