jamesmontemagno / MediaPlugin

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

Some time image is storing on the android gallery and some times the image file size is zero #337

Open Padalingam opened 7 years ago

Padalingam commented 7 years ago

I can not able see the image which is taken in the android device but some times its stored in the gallery

Bug Information

Version Number of Plugin: 3.0.1 Device Tested On: Motorola Android 6.0 Simulator Tested On: Version of VS: Version of Xamarin: 6.3 Versions of other things you are using:

Steps to reproduce the Behavior

Expected Behavior

All the images taken from the app needs to be store in the gallery

Actual Behavior

Some times it stored into the gallery and sometimes image is created but its got damages i can not able to open it again

Code snippet

var file = await CrossMedia.Current.TakePhotoAsync
(new Plugin.Media.Abstractions.StoreCameraMediaOptions
         {
             SaveToAlbum = true
         });
         if (file == null)
             return;
         string path = string.Format("{0} then {1}", file.AlbumPath, file.Path);
                await DisplayAlert("File Location", path, "OK");

Screenshotst

prashantvc commented 7 years ago

@Padalingam I am not able to reproduce this on my Galaxy S7. How often does this happen? Is this specific to any one device? Do you see this happening on simulator?

prashantvc commented 7 years ago

Because we have not received a reply to our request for more information, I am marking this issue as closed. If you are still encountering this issue on the latest version of the plugin, please don’t hesitate to reopen the ticket with the requested information. Thanks!

zuffap commented 6 years ago

Hi, reporting the same issue. One of the guys who uses my mobile app reports the same issue: photos, taken from within my app (via MediaPlugin) are properly processed by the application itself, but incorrectly stored in the device's camera roll (via "new StoreCameraMediaOptions() { SaveToAlbum = true }")- some of them have 0kb size (even though they have proper file names assigned), see the attached screenshot. image001 Tech details: Xamarin Application for Android, MediaPlugin version 3.0.1 Device Android version: 6.0 Trying to collect more information from the guy that can give us some lead.

prashantvc commented 6 years ago

Trying to collect more information from the guy that can give us some lead.

I have been trying to reproduce this issue, but nothing so far. More information like API version, device details will sure help to debug this

zuffap commented 6 years ago

The information I collected so far: Lenovo A7010a48, Android 6.0. I think about changing the application to save the photo myself into the public camera roll (not let the MediaPlugin do it), because that way I'll have more control of it as well as potential exception catching and recording. It could be related to memory issues when working with big files (images with high resolution), I also coped with some and I had to enroll Xamarin.FFImageLoading library to tackle them.

zuffap commented 6 years ago

Here's another guy complaining about zero size images being saved into the camera roll using MediaPlugin: https://stackoverflow.com/questions/42191654/xamarin-forms-media-plugin-empty-thumbnails-on-phone