-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Original image is lost if choosing not to edit for Camera plugin on Android #2020
Comments
Good day. |
From master. But create your own branch to work, and when you send the pull request, mark the “allow commits from maintainers” checkbox just in case we need to make some changes |
closing since the PR was merged |
Hi, I badly needed this fix. Just wondering on when will this fix be available. Thanks! |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Bug Report
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 1.2.1
@capacitor/core: 1.2.1
@capacitor/android: 1.2.1
@capacitor/ios: 1.2.1
Installed Dependencies:
@capacitor/cli 1.2.1
@capacitor/ios 1.2.1
@capacitor/android 1.2.1
@capacitor/core 1.2.1
Affected Platform(s)
Current Behavior
On Android device:
Open camera using Camera plugin.
Take picture
Accept picture -> navigates to edit screen
Try and continue without editing picture
No image is returned
Expected Behavior
If no edit is performed, original image should be returned
Sample Code or Sample Application Repo
const image = await Camera.getPhoto({
quality: 90,
allowEditing: true,
resultType: CameraResultType.Uri,
source: "CAMERA"
});
Reproduction Steps
On Android device:
Open camera using Camera plugin.
Take picture
Accept picture -> navigates to edit screen
Try and continue without editing picture
No image is returned
Other Technical Details
Issue is in com.getcapacitor.plugin.Camera
handleOnActivityResult
if (requestCode == REQUEST_IMAGE_EDIT)
....
Needs to check result code is either Activity.RESULT_OK or Activity.RESULT_CANCELLED.
and only go to processImage if resultCode == Activity.RESULT_OK.
If Activity.RESULT_CANCELLED || data == null && originalImageUri exists
return original image.
Other Information
The text was updated successfully, but these errors were encountered: