Skip to content
This repository has been archived by the owner on May 28, 2020. It is now read-only.

Unable to display images too large #2

Open
beta opened this issue Sep 15, 2016 · 4 comments
Open

Unable to display images too large #2

beta opened this issue Sep 15, 2016 · 4 comments
Assignees
Labels
Projects

Comments

@beta
Copy link
Owner

beta commented Sep 15, 2016

A large image with size 427 * 7200 could not be displayed, and a warning message was thrown out:

OpenGLRenderer: Bitmap too large to be uploaded into a texture (427x7200, max=4096x4096)

Images in tweets are displayed into ImageViews by Picasso. Due to limit of OpenGL, the size of a texture could not go over a limited value (which depends on the device, e.g. 4096 on Nexus 5).

To solve this bug a compressor should be implemented to limit the size of images to be displayed.

@beta
Copy link
Owner Author

beta commented Sep 15, 2016

Romain Guy's this answer offers some useful information on the minimum texture size limit.

@beta beta self-assigned this Sep 15, 2016
@beta beta added the bug label Sep 15, 2016
@beta
Copy link
Owner Author

beta commented Sep 15, 2016

It turns out that the solution is quite easy: just to use fit() when loading an image using Picasso and the image will be resized to the dimensions of the target ImageView. centerCrop() should also be used to avoid stretching.

However the bug still exists with FrescoImageViewer as mentioned in stfalcon-studio/FrescoImageViewer#3. Maybe I should rewrite the image viewer.

@troy379
Copy link

troy379 commented Sep 26, 2016

Hi, @beta !
Here is no need to rewrite the image viewer for this purpose. Here is the trick:
stfalcon-studio/FrescoImageViewer#3 (comment)

@beta
Copy link
Owner Author

beta commented Sep 27, 2016

Thank you @troy379! That works like a charm.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Bugs
To fix
Development

No branches or pull requests

2 participants