I have an image on my computer which has the dimensions width=1932 and height=2576. It was made with a smartphone and uses the "jpeg"-format.
If i open the image with any tool i like it is shown correctly.
I tried to open it with python:
from PIL import Image
img_in = Image.open(input_image_path)
Unfortunately in python it always has the dimensions width=2576 and height=1932. It this would always happen, i could fix it, but it seems only to happen for some of my images. The images are always rotated clockwise.
Do i use the the open-function wrong or how could i fix this?
Thank you very much.
Regards
Kevin
-- Edit --
Solution:
1) Please read the accepted answer
2) The following code may be used to avoid this problem: https://stackoverflow.com/a/11543365/916672