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

[expo-image-picker] Fixed downsizing cropped image on iOS #9316

Merged
merged 4 commits into from
Jul 24, 2020
Merged

[expo-image-picker] Fixed downsizing cropped image on iOS #9316

merged 4 commits into from
Jul 24, 2020

Conversation

barthap
Copy link
Contributor

@barthap barthap commented Jul 20, 2020

Why

Fixes #8079

How

Instead of getting UIImagePickerControllerEditedImage which is cropped and downsized, I take the original image and cropping rect, then crop it manually.
Based on this thread, however instead of rotating the cropping rect, I took advantage of already implemented fixOrientation and it seems to work.
Images are cropped correctly and aren't downsized anymore.

Note: Cropped images still aren't perfect squares (dimensions often differ by a few pixels). This isn't reason for this PR

Test Plan

Test using demo from issue. Tested portrait and landscape images, as well as rotated images.

  • Test on iOS Simulator
  • Test on real device.

@barthap barthap changed the title @barthap/image picker/crop fix [expo-image-picker] Fixed downsizing cropped image Jul 20, 2020
@barthap barthap changed the title [expo-image-picker] Fixed downsizing cropped image [expo-image-picker] Fixed downsizing cropped image on iOS Jul 20, 2020
@barthap barthap marked this pull request as ready for review July 21, 2020 09:03
Copy link
Contributor

@bbarthec bbarthec left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@lukmccall lukmccall left a comment

Choose a reason for hiding this comment

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

LGTM 🎉🎉🎉

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.

[expo-image-picker] [iOS] Image quality degraded after crop with allowsEditing: true
4 participants