Hi @NickNN , thank you for reaching out on Microsoft Q&A!
When I take the image with the iPad in portrait mode, the photo I took displays fine. I even save it to disk and display it later in another view, and it still looks fine, vertically.
Actually, photo pixels are saved sideways (landscape) and EXIF metadata will help you save the orientation setting (portrait or landscape). However, when you convert to Base64, the EXIF tag gets ignored, which leads to the rotation to default (landscape).
I've tried rotating it with SixLabors.ImageSharp, but it takes a long time.
You can try normalizing the image before encoding. When you load the photo into a UIImage
, iOS automatically reads the EXIF orientation. Then, redraw the UIImage
into a new graphics context, which will strip away the EXIF flag and create a new image where pixels are already rotated. Finally, you can do your work with the freshly created image.