jamesmontemagno / MediaPlugin

Take & Pick Photos and Video Plugin for Xamarin and Windows
MIT License
711 stars 360 forks source link

Android: CrossMedia.Current.TakePhotoAsync takes longer on android. #902

Closed poonamjaiswal closed 4 years ago

poonamjaiswal commented 4 years ago

On Android ,CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions()) takes 3-4 seconds delay whereas on IOS its very quick. This delay of 3-4 sec on Android is affecting application behavior.

Version Number of Plugin: 5.0.1 Device Tested On: Android Simulator Tested On: Version of VS: VS 2019 Version of Xamarin. Forms: 4.3.0.991221

Below is the code:

await CrossMedia.Current.Initialize();

if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
{
    DisplayAlert("No Camera", ":( No camera available.", "OK");
    return;
}

var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
{
    Directory = "Sample",
    Name = "test.jpg"
});

Does anyone have idea on this issue?

MatthewKapteyn commented 4 years ago

Set RotateImage to false. The function used to correct this is very slow. tbh - it's better to just use the rotation flag or server-side image processing to correct the rotation.

poonamjaiswal commented 4 years ago

Set RotateImage to false. The function used to correct this is very slow. tbh - it's better to just use the rotation flag or server-side image processing to correct the rotation.

Setting RotateImage to false worked. Thanks a lot 👍