I did not find open access to this function, but for me this is a workaround:
//1. Init picasso, create cache mCache = new LruCache(mContext); mPicasso = new Picasso.Builder(mContext).memoryCache(mCache).build(); //2. Load bitmap mPicasso.load(uri).resize(mThumbWidth, mThumbHeight).centerCrop().into(v, callback); //3. In case of error (for example, in callback), you can manually download the picture and store to cache Bitmap bmp = <custom load> //make key StringBuilder sb = new StringBuilder(uri); sb.append("\nresize:").append(mThumbWidth).append("x").append(mThumbHeight).append("\ncenterCrop\n"); mCache.set(sb.toString(), bmp);
Please note that the key is using uri and your custom transformation (resizing, centerCrop ant like this, see more at com.squareup.picasso.Utils # createKey)
source share