You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to rotate the image in Pillow according to EXIF Orientation tag.
What did you expect to happen?
New resolution is 100x150, correct orientation
What actually happened?
New resolution is 150x100, image transposed wrong way
What are your OS, Python and Pillow versions?
OS: Ubuntu
Python: 3.10
Pillow: 9.3.0
fromPILimportImage, ImageOpsim=Image.open('sample-out.tif')
print(im.size) # (150, 100) - correctim=ImageOps.exif_transpose(im)
print(im.size) # (150, 100) - not correctim.save('output.tif') # you may save and see that now image rotated 540 degrees and does not contain
exiftool -n output.tif
...
Image Width : 150
Image Height : 100
# there is not Orientation tag anymore
...
What did you do?
I have a simple tiff image 150x100px rotated 90 degrees according to exif tag:
sample-out.zip
I tried to rotate the image in Pillow according to EXIF Orientation tag.
What did you expect to happen?
New resolution is 100x150, correct orientation
What actually happened?
New resolution is 150x100, image transposed wrong way
What are your OS, Python and Pillow versions?
Reason
Image.transpose
callsImage.load()
.Image.load()
callsTiffImageFile.load()
TiffImageFile.load()
callsImageFile.load()
ImageFile.load()
callsTiffImageFile.load_end()
load_end()
transposes image.After
Image.load()
is done, image is transposed again.The text was updated successfully, but these errors were encountered: