Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picked image is rotated 90 degrees on Android #101

Closed
dzebas opened this issue Jul 4, 2022 · 3 comments
Closed

Picked image is rotated 90 degrees on Android #101

dzebas opened this issue Jul 4, 2022 · 3 comments

Comments

@dzebas
Copy link

dzebas commented Jul 4, 2022

Description
When you pick image with PickAsync on Android result image is rotated by 90 degrees.
Same code works fine in iOS.

Expected behavior
Picked image should be displayed in same orientation as it was originally taken e.g. portrait or landscape.

Steps to reproduce the behavior

var request = new MediaPickRequest( 1, MediaFileType.Image )
{
    PresentationSourceBounds = PhotoSize.Full,
    Title = "Select image"
};

var results = await MediaGallery.PickAsync( request );
var file = results?.Files?.ToArray()?.First();

byte[] imageData;
var stream = await file.OpenReadAsync(); 

using (MemoryStream ms = new MemoryStream())
{
    stream.CopyTo( ms );
    imageData = ms.ToArray();
}

return imageData;

Configuration
Device: Samsung S7, Samsung Galaxy Tab A7
OS Version: Android 11
Plugin Version: 2.1.1
Framework: Xamarin

@dimonovdd
Copy link
Owner

dimonovdd commented Jul 4, 2022

Hi. This is correct behavior. Images are processed without any changes, See metadata

#99

@dzebas
Copy link
Author

dzebas commented Jul 4, 2022

Thank you dimonovdd for a quick reply!

So if I want to display it the way it was originally taken, what should I do? You mentioned metadata, do you have any samples on how to use it?

Cheers.

@dimonovdd
Copy link
Owner

See sample project.
I use MetadataExtractor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants