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

[TIMOB-16508] Scale bitmap if too large to load into texture. #5385

Closed
wants to merge 1 commit into from

Conversation

hieupham007
Copy link
Contributor

Testing steps in JIRA

@@ -291,6 +291,7 @@ public Bitmap getBitmap()
* If decode fails because of the odd Android 2.3/Gingerbread behavior (TIMOB-3599), retry loading the original image.
* This method should be called from a background thread when needRetry is set to true because it may block
* the thread if it needs to retry several times.
* If bitmap's size exceeds GL allowance of 2048x2048 (this may happen when taking a photo), scale it with respect to ratio.
Copy link
Contributor

Choose a reason for hiding this comment

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

2048 is not fixed. This is actually device dependent (GL_MAX_TEXTURE_SIZE). The S4 I am testing on reports limit to be 4096. And 2048 might still be too large on old devices.

Also if you really want to scale down an image by default, it might be easier to set the inSampleSize irrespective of the needRetry parameter. You can get size of bitmap by passing inJustDecodeBounds and adjusting inSampleSize initially

@vishalduggal
Copy link
Contributor

The PR will work but makes assumptions that are incorrect. Please address comments

@vishalduggal
Copy link
Contributor

We already have methods to resize images. Developers should not be loading Camera images directly into memory without resizing. Going to mark the ticket as Wont Fix. Closing this PR.

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