Prevent bitmap too large to be uploaded into a texture android

Pratik picture Pratik · Mar 25, 2014 · Viewed 27.1k times · Source

I need to display original image in full screen in gallery form. For thumb it will be work perfectly and when I try to display that image in full screen with original source it will not be able to display. In most cases if the image resolution is greater then 2000 then it will display error bitmap too large to be uploaded into a texture android.

I want to prevent this, I have search google but not getting any answer regarding this.

Answer

Phileo99 picture Phileo99 · Mar 21, 2015

I came across the same problem and came up with a one liner solution for this problem here:

Picasso.with(context).load(new File(path/to/File)).fit().centerCrop().into(imageView);