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 image compression OOM exception #1627

Merged
merged 4 commits into from
Sep 20, 2021

Conversation

amiralies
Copy link
Contributor

  • Refined target dimension algorithm to ensure both height and width are less than their corresponding max values
  • Avoid using separate bitmap instances to allocate less memory
  • Use exif orientation instead of bitmap rotation to avoid calling extra Bitmap.createBitmap

@amiralies amiralies changed the title Fix compression oom Fix image compression OOM exception Jul 20, 2021
@amiralies amiralies marked this pull request as draft July 20, 2021 11:51
@amiralies
Copy link
Contributor Author

Looks like we still have issues with very large imgages (for example i've testes with 64MP phone and an instant crash happened)
working on this

@amiralies
Copy link
Contributor Author

Ok, I've just added a commit that uses in sample size when loading a bitmap to load a sampled image and probably consume less memory.

@amiralies amiralies marked this pull request as ready for review July 20, 2021 13:22
@ivpusic ivpusic merged commit 5333954 into ivpusic:master Sep 20, 2021
@ivpusic
Copy link
Owner

ivpusic commented Sep 20, 2021

thanks!

kyunkakata added a commit to kyunkakata/react-native-image-crop-picker that referenced this pull request Jun 8, 2022
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.

2 participants