0

Each await MediaPicker.CapturePhotoAsync(); saves duplicate photo to gallery. I use the newest Xamarin Essential and Xamarin Forms. How can I get the path to gallery and delete duplicate photo? I only want to keep one copy of photo first in FileSystem.CacheDirectory and then moving it to right directory. Code from MS: https://learn.microsoft.com/en-us/xamarin/essentials/media-picker?tabs=android

  • And your code, please? – Shaw Jul 04 '22 at 21:59
  • Code attached . – NightCity10932 Jul 05 '22 at 05:35
  • In the official document, the photo will be saved to the path set by the `LoadPhotoAsync` method when you call the `MediaPicker.CapturePhotoAsync();` method. And the gallery will not save it. – Liyun Zhang - MSFT Jul 05 '22 at 07:06
  • It could be Android bug that I got photo in gallery too? – NightCity10932 Jul 05 '22 at 18:20
  • The same problem I got with xam.media.plugin, on some devices it saves duplicate in gallery but on other ones it saves just one photo in my path. https://social.msdn.microsoft.com/Forums/en-US/a38b54de-2121-4939-85e5-20e3a7d598ad/xampluginmedia-saving-photo-in-both-internal-storage-and-sd-card-on-android?forum=xamarinforms – NightCity10932 Jul 05 '22 at 18:40
  • You can try to update the version of the xamarin.forms and the xamarin.essentials. I had done a sample to test and it worked well. – Liyun Zhang - MSFT Jul 06 '22 at 06:29

0 Answers0