Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Large images (from file) not loading in Picasso, no obvious error seen

I'm writing an app which gets a list of the images from the gallery on a device and then shows them in a GridView. In my adapter I have the following code (where the width and height are those of the view it will be placed in):

PicassoSingleton.with(mContext).load("file://" + imageUri).resize(getImageWidth(), getImageHeight()).centerInside().placeholder(R.drawable.image_placeholder).error(R.drawable.image_error).into(holder.image);

On most devices this works really well. However, on some devices where the photos taken are very large (such as the Samsung Galaxy S5- 16MP) some images do not load, and the error resource is displayed. I do not see any obvious log messages from Picasso debugging, only the following:

D/Picasso(20171): Main        errored      [R7]+501ms

I presume this is due to memory issues, but I am not sure how to go about fixing these. Is it possible to tell Picasso to compress the images? Or is there something else I'm missing?

Thanks

like image 323
Michael Avatar asked Jun 17 '14 09:06

Michael


1 Answers

This issue appears to be linked to https://github.com/square/picasso/issues/539

Updating to the latest version of Picasso (here 2.3.3-SNAPSHOT) fixed this

like image 91
Michael Avatar answered Sep 28 '22 16:09

Michael