I'm currently using Picasso and OkHttp for my bitmap caching. What I want to do is retrieve a specific cached bitmap, draw on it, and then put that drawn on bitmap back into the memory and disk cache. My implementation is pretty standard, I'm just using Target and adding the loaded bitmap to a custom ImageView which resides in a GridView. I've been looking around and I can't seem to find a way to do this. Do these libraries even support something like this?
Picasso is just the library for downloading caching and displaying the image (with perks like transformations, cross fading etc) not for editing. What you seem to do seems to go beyond the scope of Picasso usage.
I'd say you can still use Picasso for downloading the image if you want to, but when you get a Bitmap it's your app that has do store it's modified version. So when a user finishes drawing it you must store it locally into a file yourself (if it's a big image you can also create separate smaller thumbnails for GridView) and use this version. To save changed Bitmap contents to a file you can call
outBitmap.compress(Bitmap.CompressFormat.PNG, 100, outStream);
You can load local files into your GridView using Picasso too: Picasso.with(context).load("fileUrl").into(mImageView);
. So in your code you would check if you have local edited version and load it from local file using Picasso or load it from server using Picasso otherwise.
If you want to save image on the server you can send it to server after user has edited it. Then Picasso+OkHttp will download it again (assuming you updated http cache attributes like ETag on server).
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