Skip to content
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

fix(camera): return original image if editing is cancelled #566

Merged
merged 2 commits into from
Aug 26, 2021

Conversation

mlynch
Copy link
Contributor

@mlynch mlynch commented Aug 25, 2021

There's a fairly popular issue on the old repo (#2835) on what to do when allowEdit: true is set when calling Camera.getPhoto() and the user cancels the edit operation.

This change returns the original image if the editing activity result code comes back as canceled, and I think it makes sense if you consider the UX that Android uses for editing. If the user taps above the bottom sheet in the below screenshot, I think the intention is to keep the original image but skip editing. This also makes sense since allowEdit is a hint, not a requirement.

Without this change, the activity is treated as cancelled and no image is returned.

OQuEbCWY jpg large

@mlynch mlynch requested a review from carlpoole August 25, 2021 21:09
Copy link
Member

@carlpoole carlpoole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, tested on my samsung S9+ Android 10

@mlynch
Copy link
Contributor Author

mlynch commented Aug 25, 2021

Thanks @carlpoole. Apologies but had to add a bit more to check for the same case when picking an image from the photos, as that was still not working correctly. With this commit that should be good as well if you're able to take another look.

Copy link
Member

@carlpoole carlpoole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated issue also occurred from image picking and solution fixes it

@mlynch mlynch merged commit 4786841 into main Aug 26, 2021
@mlynch mlynch deleted the fix-allow-edit-cancelled branch August 26, 2021 13:23
carlpoole added a commit that referenced this pull request Sep 1, 2021
* docs(browser): Add clarifications to browser events (#560)

* feat(storage): make StorageConfiguration init public (#532)

* fix(filesystem): allow copy if from is not parent of to (#546)


Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>

* fix(camera): cleanup camera images if not needed (#563)

* fix(camera): return original image if editing is cancelled (#566)

* fix(camera): return original image if editing is cancelled

* fix(camera): Fix allowEdit: true when picking from photos

* fix(camera): Resize not respecting aspect ratio on iOS (#568)

* chore: adding stuff to deploy plugins to cocoapods

* chore: adding npm install to script

* chore: updating source to point to proper tag

* chore: turning lerna concurrency to 1 for cocoapod builds

* chore(android): native library publishing task to test (#575)

* fix(local-notifications): Throw errors if missing mandatory channel fields (#577)

* fix(push-notifications): Throw errors if missing mandatory channel fields (#576)

* chore: adding manual task to deploy plugins to cocoapods

* docs(notifications): Add links to explain the Android importance and visibility values (#584)

* chore: Correct sources path in podspec (#586)

* chore: fixing action sheet podspec

* feat(geolocation): Throw error if location is disabled (#589)

* fix: Correct missing source_files path (#590)

* chore: adding full path to podspecs for cocoapods deploy (#591)

* chore(release): publish [skip ci]

 - @capacitor/action-sheet@1.0.3
 - @capacitor/app@1.0.3
 - @capacitor/app-launcher@1.0.4
 - @capacitor/browser@1.0.3
 - @capacitor/camera@1.0.5
 - @capacitor/clipboard@1.0.3
 - @capacitor/device@1.0.3
 - @capacitor/dialog@1.0.3
 - @capacitor/filesystem@1.0.3
 - @capacitor/geolocation@1.1.0
 - @capacitor/haptics@1.0.3
 - @capacitor/keyboard@1.0.3
 - @capacitor/local-notifications@1.0.5
 - @capacitor/network@1.0.3
 - @capacitor/push-notifications@1.0.4
 - @capacitor/screen-reader@1.0.3
 - @capacitor/share@1.0.4
 - @capacitor/splash-screen@1.1.2
 - @capacitor/status-bar@1.0.3
 - @capacitor/storage@1.1.0
 - @capacitor/text-zoom@1.0.3
 - @capacitor/toast@1.0.3

Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
Co-authored-by: fadoscha <fabian.schaffner@gmail.com>
Co-authored-by: Tachibana Shin <45375496+tachibana-shin@users.noreply.github.com>
Co-authored-by: Max Lynch <max@drifty.com>
Co-authored-by: Ely Lucas <ely@meta-tek.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants