xamarin-forms-samples
xamarin-forms-samples copied to clipboard
UWP implementation of PhotoLibrary will never create a target folder
Sample
https://github.com/xamarin/xamarin-forms-samples/tree/master/SkiaSharpForms/Demos/Demos/SkiaSharpFormsDemos.UWP
Description
There is a bug in the UWP implementation of PhotoLibrary. In SavePhotoAsync, if the target folder does not exist, then GetFolderAsync throws an exception, and so the test at line 59, if (folderDirectory == null), will always fail because folderDirectory is initialised to point at the pictures directory. Thus, the specified folder will never be created if it does not already exist.
Steps to Reproduce
- Run the FingerPaint demo and save a picture when there is no FingerPaint folder within Pictures
Expected Behavior
The FingerPaint folder is created and the picture is saved to it
Actual Behavior
The FingerPaint folder is not created and the picture is saved to the root pictures folder
Information
Visual Studio 2017 running UWP build of demo on Windows 10