Repository navigation
Description
(AI assisted description)
Description
When using MediaPickerOptions.RotateImage = true on Windows, images appear to have their EXIF orientation applied twice.
The issue is reproducible with images whose pixel data is physically unrotated (0Β°) and where only the EXIF orientation flag differs.
Reproduction Matrix
| Physical Pixels | EXIF Orientation | Result after RotateImage=true |
|---|---|---|
| 0Β° | 0Β° | 0Β° |
| 0Β° | 90Β° (EXIF=6) | 180Β° |
| 0Β° | 180Β° (EXIF=3) | 0Β° |
| 0Β° | 270Β° (EXIF=8) | 180Β° |
Expected Results
| Physical Pixels | EXIF Orientation | Expected Result |
|---|---|---|
| 0Β° | 0Β° | 0Β° |
| 0Β° | 90Β° | 90Β° |
| 0Β° | 180Β° | 180Β° |
| 0Β° | 270Β° | 270Β° |
Environment
- .NET MAUI 10
- Windows
MediaPickerOptions.RotateImage = true
Suspected Location
src/Essentials/src/MediaPicker/ImageProcessor.windows.cs
Relevant code:
var orientation = await GetImageOrientation(decoder);
encoder.BitmapTransform.Rotation = orientation;
var pixelData = await decoder.GetPixelDataAsync(--> which defaults are used here?);
encoder.SetPixelData(
decoder.BitmapPixelFormat,
decoder.BitmapAlphaMode,
decoder.OrientedPixelWidth,
decoder.OrientedPixelHeight,
decoder.DpiX,
decoder.DpiY,
pixelData.DetachPixelData());Analysis
The observed behavior suggests that orientation is being applied twice.
The output follows the pattern:
0Β° -> 0Β°
90Β° -> 180Β°
180Β° -> 360Β° (appears as 0Β°)
270Β° -> 540Β° (appears as 180Β°)
which is equivalent to:
result = orientation * 2 (mod 360)
This strongly suggests that the EXIF-derived orientation is being applied twice during processing.
Possible areas to investigate:
decoder.GetPixelDataAsync()decoder.OrientedPixelWidth / decoder.OrientedPixelHeightencoder.BitmapTransform.Rotation
The interaction between these APIs may already produce orientation-aware pixel data while BitmapTransform.Rotation applies the same orientation again.
Additional Notes
This does not appear to be an EXIF cleanup issue.
The resulting file no longer contains the original EXIF orientation information, but the pixel data itself is already rotated incorrectly.
The issue seems to occur during the Windows image processing pipeline rather than during metadata preservation/removal.
I can reproduce this reliably using the same image with only the EXIF orientation value changed (0Β°, 90Β°, 180Β°, 270Β°).
Activity
HarishKumarSF4517 commentedon Sep 16, 2026
This issue has been validated in Visual Studio Insiders 12120.281with .NET MAUI versions 10.0.100 and 10.0.101. It can be reproduced on Windows platform.
Screen.Recording.2026-09-16.153737.mp4
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
kubaflo commentedon Oct 10, 2026
Thank you for the report and the investigation details. We are closing this as completed: Windows MediaPicker no longer applies encoder rotation after decoding has already applied EXIF orientation, preventing the reported double rotation. The reporter confirmed the fix works.
Supporting evidence: #38591 (merged into
inflight/current).This records the merged source change; it does not imply that the fix is present in every released .NET MAUI package.
If you can still reproduce the reported behavior in a build that includes the linked change, please comment here with the exact version and reproduction details so we can reopen and investigate. The existing reproduction and discussion remain available; a new issue is not required.
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)
[Windows] MediaPicker: Apply EXIF orientation only once (#38591)