Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Picture Chooser Android - Exception prevents Exif rotation when selecting from library #65

Open
grahampett opened this issue Mar 11, 2016 · 2 comments

Comments

@grahampett
Copy link

When using IMvxPictureChooserTask.ChoosePictureFromLibrary() on Android, the method GetRealPathFromUri is returning null, causing a Java.Lang.IllegalArgumentException from the Android.Media.ExifInterface constructor in ExifRotateBitmap. This is handled by the try/catch block in LoadScaledBitmap, but returns the image without applying the correct rotation (e.g. for photos taken by devices that set Exif orientation rather than rotating the image).

Tested on Samsung Galaxy Note 5 running Lollipop. Also saw the exception on Nexus 5X running Marshmallow (but this camera rotates the image rather than setting Exif so no visible issue for user).

@chanti-github
Copy link

chanti-github commented Jul 29, 2016

i am also facing the same issue Any Updates ??

i am getting the following stack trace :
Problem seem in Exit Rotate IllegalArgumentException: filename cannot be null
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/2098/3efa14c4/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue* parms) [0x00084] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1029
at Android.Runtime.JNIEnv.FinishCreateInstance (IntPtr instance, IntPtr jclass, IntPtr constructorId, Android.Runtime.JValue* constructorParameters) [0x0000b] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:306
at Android.Media.ExifInterface..ctor (System.String filename) [0x000cc] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Media.ExifInterface.cs:154
at MvvmCross.Plugins.PictureChooser.Droid.MvxPictureChooserTask.ExifRotateBitmap (Android.Content.ContentResolver contentResolver, Android.Net.Uri uri, Android.Graphics.Bitmap bitmap) [0x0000d] in :0
at MvvmCross.Plugins.PictureChooser.Droid.MvxPictureChooserTask.LoadScaledBitmap (Android.Net.Uri uri) [0x00073] in :0
--- End of managed exception stack trace ---

@chanti-github
Copy link

Any Updates ??

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

No branches or pull requests

2 participants