EXIF supports 'Orientation' parameter, which may instruct the image to be opened after rotating by 90 degrees. This is respected by all software I have tested, but unfortunately not by imagesize, causing incorrect results.
Sample image:
Same image with orientation EXIF set to rotate 90 degrees CW:
However, when I run the following code:
print(imagesize.get('example-exif.jpg')) # This prints (300, 100)
print(imagesize.get('example-exif-rotated.jpg')) # This prints (300, 100)
# Note that numpy image dimensions are (height, width, colors)
print(imageio.imread('example-exif-rotated.jpg').shape) # This prints (100, 300, 3)
print(imageio.imread('example-exif-rotated.jpg').shape) # This prints (300, 100, 3)
EXIF supports 'Orientation' parameter, which may instruct the image to be opened after rotating by 90 degrees. This is respected by all software I have tested, but unfortunately not by imagesize, causing incorrect results.
Sample image: Same image with orientation EXIF set to rotate 90 degrees CW:
However, when I run the following code: