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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With