-
-
Notifications
You must be signed in to change notification settings - Fork 360
System.NullReferenceException: CrossMedia.Current.PickPhotoAsync. (HEIC/IPhoneX) #452
Comments
WEIRD ... when I pass |
Can you pull down the source code and run through the test apps and try to reproduce. I don't have an iphone x |
The exception is in the MediaPickerDelegate line 370 ...
the image is not null, quality=1 and the path is also correct ... if passing 0.9 as quality there is no exception When I split up the code in two lines I can see that
jpg = null |
Interesting, what if you do .99? |
.99 is working also ... |
Do you happen to know what the file extension is on it? Curious if i can put some sort of hack in there. I don't have any devices that take these photos. |
It's just jpg ... Maybe you can do something with the data from the CGImage? BitmapInfo: NoneSkipLast I found this post. It might have something to do with the image size, which is too big to use as JPG, according to this post:
This fixed it (but I don't know if it's good performance wise)
|
In 3 places when trying to convert to jpeg we need to adjust quality
Awesome! Good one! Very tricky. I am pushing out: 3.1.3.222-beta Can you test this out. The AsJPEG code is in 3 different places. |
I get a null reference exception in the
CrossMedia.Current.PickPhotoAsync
when selecting a picture from the library. It only happens with some pictures.I can't pinpoint which files go wrong but I think it might have something to do with the new HEIC format. It's also possible that it goes wrong with pictures taken on an iPhoneX.
Version Number of Plugin: 3.1.3
Device Tested On: iPhoneX
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at Plugin.Media.MediaPickerDelegate+d__25.MoveNext () [0x00380] in :0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in :0
at Plugin.Media.MediaPickerDelegate+d__9.MoveNext () [0x000d4] in :0
The text was updated successfully, but these errors were encountered: