Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CameraCaptureUI.CaptureFileAsync() is returning a corrupt StorageFile if user selects "Save as a copy" option on the OS dialog #2435

Open
mimtiaz3555 opened this issue Dec 7, 2023 · 1 comment
Assignees
Labels
Pri3 Topic is in the bottom 50% of page views for the repo or was not created via Feedback control.

Comments

@mimtiaz3555
Copy link

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:

image

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

@issues-automation issues-automation bot added the Pri3 Topic is in the bottom 50% of page views for the repo or was not created via Feedback control. label Dec 7, 2023
@SleepyDevelops
Copy link

Any updates on this? The only fix we found was to disable cropping, which isn't really a solution.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Pri3 Topic is in the bottom 50% of page views for the repo or was not created via Feedback control.
Projects
None yet
Development

No branches or pull requests

3 participants