Skip to content

JPEG images not having EXIF orientation applied #3748

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

Closed
fluffy-critter opened this issue Mar 26, 2019 · 2 comments
Closed

JPEG images not having EXIF orientation applied #3748

fluffy-critter opened this issue Mar 26, 2019 · 2 comments
Labels

Comments

@fluffy-critter
Copy link

fluffy-critter commented Mar 26, 2019

What did you do?

Loaded a JPEG taken on an iPhone 5 and saved it back out

What did you expect to happen?

Image should have been saved out with the correct orientation

What actually happened?

Image was saved at its "native" orientation

What are your OS, Python and Pillow versions?

  • OS: Linux, CentOS 7.5
  • Python: 3.7.2
  • Pillow: 5.4.1

Please include code that reproduces the issue and whenever possible, an image that demonstrates the issue. Please upload images to GitHub, not to third-party file hosting sites. If necessary, add the image to a zip or tar archive.

The best reproductions are self-contained scripts with minimal dependencies. If you are using a framework such as plone, Django, or buildout, try to replicate the issue just using Pillow.

import PIL.Image
import sys

image = PIL.Image.open(sys.argv[1])
image.save("foo.jpg")

Image is stored in this .zip file to prevent github's uploader from correcting the file automatically:

orientation.zip

Notably, exiftool shows the original as having the flag: Orientation: 180

Judging by past PRs #52 and #224, and issue #183, this is a regression.

@radarhere radarhere added the Exif label Mar 26, 2019
@radarhere
Copy link
Member

I don't see the connection with #52 and #224, and #183 declared that it wouldn't be fixed. So this isn't a regression.

I would have a look at https://stackoverflow.com/a/6218425/4093019. There is also PR #3687 in the queue, which would provide a simpler way to do this.

@fluffy-critter
Copy link
Author

Ah, I see what happened, I was looking at issues on other things that were referencing Pillow. My bad!

I'll look forward to #3687 and make use of that in my project instead. Thanks!

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

No branches or pull requests

2 participants