Open_image transposes image on some pictures

I’m trying to train a segmentation UNet with fastai. I’ve found some weird behaviour I can’t explain. Some of my images will be flipped when opened with open_image. I’ll add some examples below.
For this picture both fastai and opencv read the image correctly.

But in the next example fastai and opencv will transpose the image for some reason, but not the mask.

Is there some kind of parameter that I need to set or is this a bug?

Ok, I’ve found the problem. Turns out that some of the images I used were taken with a phone in landscape. The phone then adds metadata to say that the image has to be flipped. Some libraries read this metadata and some don’t. So all I had to do was remove all the metadata from the images before adding them in the training folder.