jamesmontemagno / MediaPlugin

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

Destination folder doesn't work in 6.0.2.1 #959

Open tiagosarri opened 1 year ago

tiagosarri commented 1 year ago

After updating to v6.0.2.1, the library does not save photos in the destination folder e.g.: MyFolderApp, and is saved in the root of the photos folder.

my code is like this:

        public async Task TakeNewPicture()
        {
            if (!await CheckPermissions())
                return;

            await CrossMedia.Current.Initialize();

            if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
            {
                await App.NavigationService.NavigationStack[0].DisplayAlert("Camera not available", ":( No camera found", "OK");
                return;
            }

            AttachedPicture = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
            {
                Directory = "MyFolderApp",
                Name = string.Format("{0}_{1}", SelectedOrder.ServiceOrderNumber, DateTime.Now.ToString("dd_MM_yyyy_HH_mm_ss")),
                AllowCropping = true,
                SaveToAlbum = true,
                PhotoSize = PhotoSize.Custom,
                CustomPhotoSize = 65
            });

            if (AttachedPicture == null)
                return;

            await App.NavigationService.NavigationStack[0].DisplayAlert("Done!", "Photo successfully attached!", "OK");
        }

In the penultimate version, this problem did not happen.

I am working with versions of products

Version Number of Plugin: v6.0.2.1 Device Tested On: Android Simulator Tested On: Android Version of VS: 17.6.2 Version of Xamarin: 5.0.0.2578