subsampling-scale-image-view icon indicating copy to clipboard operation
subsampling-scale-image-view copied to clipboard

W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (700x3959, max=2048x2048)

Open creotiv opened this issue 4 years ago • 10 comments

Adding image the same as in tutorial, and getting same error, as on other image views.

What's wrong?

creotiv avatar Jul 16 '20 11:07 creotiv

Please post your code. I can't help if you delete the issue template.

davemorrissey avatar Jul 16 '20 18:07 davemorrissey

Here is code: https://gist.github.com/creotiv/29a257e99299670e51434196687169db

I'm trying to create module for react-native.

creotiv avatar Jul 16 '20 18:07 creotiv

so the interesting part here is the size of the picture that trying to put into texture. Original image is 900x5000, But on some devices i see W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (4500x28000, ... So for some reason picture upscale in 4-6 times.

creotiv avatar Jul 16 '20 18:07 creotiv

I saw same behaviour when i tried to use https://github.com/DylanVann/react-native-fast-image lib

creotiv avatar Jul 16 '20 18:07 creotiv

i tested on various devices and it doesnt corelate to Android version nor screen resolution. Ive tested from mhdpi to xxxhdpi and Android 5.1.1 to Android 10.

creotiv avatar Jul 16 '20 18:07 creotiv

For example samsung N915F is giving crash, at the same time Blackview BV7000 is working fine

creotiv avatar Jul 16 '20 18:07 creotiv

https://www.blackview.hk/blackview-190/ https://www.phonemore.com/specs/samsung/galaxy-note-edge/sm-n915f/

creotiv avatar Jul 16 '20 18:07 creotiv

I don't know what URI you're using. If you're using a resource, Android may scale it. Store images in assets, or at least in drawable-nodpi.

davemorrissey avatar Jul 16 '20 19:07 davemorrissey

im using file from phone like /sdcard/..

creotiv avatar Jul 17 '20 07:07 creotiv

Also setting view to the software acceleration doesn't solve a problem(i think it can be rewrited in Canvas)

creotiv avatar Jul 17 '20 12:07 creotiv