Mediaplugin: Image taken from iPhone shows rotated on Android device

Created on 12 Mar 2018  路  1Comment  路  Source: jamesmontemagno/MediaPlugin

Bug Information

Version Number of Plugin: 3.1.3 (Stable)
Device Tested On: IPhone 6, Motorola G5S+
Simulator Tested On: NA
Version of VS: VS 2015, VS Mac
Version of Xamarin: 4.8.0.756
Versions of other things you are using: NA

Steps to reproduce the Behavior

Take Photo from IPhone camera and save binary in DB
If you open same binary in Image View on Iphone, it shows correct image
But If you open same image binary in Android device, it shows left side rotated image

Expected Behavior

Image should show without rotation.

Actual Behavior

Image shows rotated on android device

Code snippet

var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
                    {
                        SaveToAlbum = false,
                        CompressionQuality = 90,
                        PhotoSize = PhotoSize.Medium,
                        RotateImage = false,
                    });

Screenshots

Image on Iphone (Taken on Iphone) ->
correctimage

Image on Android (taken on Iphone) ->
rotatedimage

If I try to read EXIF, it gives TopRight. It should be TopLeft

using (var stream = file.GetStream())
                    {
                        var photoinfo = ExifLib.ExifReader.ReadJpeg(stream);
                        ExifLib.ExifOrientation orientation = photoinfo.Orientation;
                    }

Is there a way I can update, EXIF for this image file.

bug

Most helpful comment

Use: GetStreamWithImageRotatedForExternalStorage

>All comments

Use: GetStreamWithImageRotatedForExternalStorage

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ivmazurenko picture ivmazurenko  路  3Comments

Soumya-G picture Soumya-G  路  5Comments

jimutt picture jimutt  路  8Comments

DNF-SaS picture DNF-SaS  路  3Comments

fadaEntrepidus picture fadaEntrepidus  路  6Comments