The StorageFile returned from the CaptureFileAsync() call is corrupt when user selects Save as a copy instead of Save after performing the OS Photos dialog popup that is part of the CaptureFileAsync() call. It is 0 bytes in size.
Why is the image coming back corrupt? And is there a way of checking where the user saved the edited copy?
The API is using the MS Photos app to let the user save as a copy as shown below:
When using CameraCaptureUI in a UWP app in Windows 11 23H2, if cropping is allowed as follows:
CameraCaptureUI captureUI = new CameraCaptureUI();
captureUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
captureUI.PhotoSettings.CroppedSizeInPixels = new Size(200, 200);
StorageFile photo = await captureUI.CaptureFileAsync(CameraCaptureUIMode.Photo);
The StorageFile returned from the CaptureFileAsync() call is corrupt when user selects Save as a copy instead of Save after performing the OS Photos dialog popup that is part of the CaptureFileAsync() call. It is 0 bytes in size.
Why is the image coming back corrupt? And is there a way of checking where the user saved the edited copy?
The API is using the MS Photos app to let the user save as a copy as shown below:
The issue is verified as shown in the attached Microsoft FAQ link: https://learn.microsoft.com/en-us/answers/questions/1454858/cameracaptureui-capturefileasync()-is-returning-a