dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.24k stars 1.76k forks source link

`Image` displays JPG photos taken in Portrait orientation in Landscape orientation (regression in 8.0.10) #21314

Closed zeldafreak closed 7 months ago

zeldafreak commented 8 months ago

Description

After updating .NET MAUI from v8.0.7 to v8.0.10, photos taken in Portrait orientation on my iPad Pro (11", 4th-gen, iOS v17.4) using the built-in Camera app and rear-facing camera are displayed in Landscape orientation.

I'm able to reproduce this reliably by taking photos in the Camera app (or in a custom app that uses iOS APIs to take photos), but not with the MediaPicker, so my reproduction repository comes with a photo I took. I think this is because MediaPicker always returns the photo in PNG format, and this issue seems to only occur due to metadata (EXIF?) in the JPEG file.

You can reliably reproduce this issue by simply switching between 8.0.7 and 8.0.10. The screenshots below are from my reproduction repository, and the only difference between them is the .NET MAUI version the project is referencing.

If you just want an example image that can be used to reproduce this, you can find one here.

NOTE: This might affect other platforms/devices, but I'm specifically calling out iPad Pro because that's where I've reproduced it.

.NET MAUI v8.0.7

MAUI 8 0 7-tiny

.NET MAUI v8.0.10

MAUI 8 0 10-tiny

Steps to Reproduce

Link to public reproduction project repository

https://github.com/zeldafreak/MauiImageRegression/tree/main

Version with bug

8.0.10 SR3

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.7 SR2

Affected platforms

iOS

Affected platform versions

iOS 17.4, iPad Pro (11", 4th-gen)

Did you find any workaround?

Rolling back to v8.0.7 restores the original behavior.

Relevant log output

No response

Redth commented 8 months ago

Looks like this could be the culprit: https://github.com/dotnet/maui/pull/19411/files#diff-48977a1f6983e847819315f0fcab9bc88a0bf15ba282e24616895a7c65713774R149

MitchBomcanhao commented 8 months ago

here to report a similar thing. the captured images all have the same orientations on 8.0.7 and 8.0.10, but when loading them up to be displayed they all have the wrong orientation on 8.0.10, so this is quite broken.

RoiChen001 commented 8 months ago

Can repro this issue at iOS device on the latest 17.10 preview2(8.0.10 and Microsoft.Maui.Controls 8.0.20-nightly.10336+sha.d03a2c66aa-azdo.9265184).

rodrigoavots commented 7 months ago

The same problem occurs on Android Version 11 and 12 are ok, Android 13 is rotating 90º

PureWeen commented 7 months ago

The same problem occurs on Android Version 11 and 12 are ok, Android 13 is rotating 90º

can you log a new issue with a repro?