Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image size too large for nexus 7?

I have a 1092 x 1596 2.23mb png that I want to set as the background for my activity. It works when I test it with a galaxy s, and galaxy tab 2 10.1, but when I test it with a nexus 7, I get an error:

11-30 08:37:36.961: W/OpenGLRenderer(25918): Bitmap too large to be uploaded into a texture (1454x2125, max=2048x2048)

Anyone have any suggestions? Should I not be using such a large image for the background?

like image 830
ha1ogen Avatar asked Feb 18 '23 07:02

ha1ogen


2 Answers

Perhaps the image is being scaled up for the nexus 7 device because of where you've put it in your res/drawable folders.

Try moving the image to the res/drawable-xhdpi folder and try again, this should scale the image down a bit rather than up to the Nexus 7 display (Nexus 7 display is tvdpi, whereas I believe the two galaxy devices you use are mdpi, so the image might not get scaled up for those if you are already placing it in the mdpi folder.).

Other than that though, what @Qw4z1 says about using images that are too large is exactly correct. Try creating resources of different sizes for each drawable density folder and going from there, much more efficient, and will lead to a smaller .apk filesize as well.

like image 50
biddulph.r Avatar answered Feb 23 '23 01:02

biddulph.r


Uhm.. Doesn't that error code say that you image is 1454x2125? 2125 > 2048 afaik.

To answer your question, though, yes it is a bad idea. Some devices just can'n handle too large images.

Check this SO question for more details on the subject.

like image 24
Qw4z1 Avatar answered Feb 23 '23 00:02

Qw4z1