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?
A solution I found is to follow this code: https://stackoverflow.com/a/11543365/916672