-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
PIL.Image.open is rotating jpeg images #4703
Comments
Thank you for reporting an issue. Follow these guidelines to ensure your issue is handled properly. If you have a ...
We know asking good questions takes effort, and we appreciate your time. What did you do?What did you expect to happen?What actually happened?What are your OS, Python and Pillow versions?
code goes here |
I would imagine that the images you are dealing with have an EXIF orientation tag. This means that the image data is saved in one position, and then the image instructs the viewer to rotate it another way. Pillow does not automatically apply this transformation to the data. However, it has a method to do so - https://pillow.readthedocs.io/en/stable/reference/ImageOps.html#PIL.ImageOps.exif_transpose Here is an example using it. You can try this and check if it resolves your problem. from PIL import Image, ImageOps
im = Image.open("file.jpg")
im = ImageOps.exif_transpose(im) However, this is all a guess. To be sure, please provide an image, and ideally, the code that you are running over it. |
Hello, yes it is true. Thank you very much. |
Pillow 8.0.0 is automatically rotating images upon .open based on EXIF Orientation tag. Is there a way to stop that? Automatic rotation is NOT expected from Pillow. I have an image with following EXIF: |
@Divjyot would you be able to open a new issue with a copy of the image attached? |
Doing the exif_transpose() for a .jpg I get this error:
At post-mortem:
Is this a(nother) bug, or what to do? |
The above comment was continued as #6882 |
Hello,
I am trying to load images with Image.open. However, the images are autorotated if they were jpg images.
The text was updated successfully, but these errors were encountered: