The current Uri handlers are great for many cases, but in our app (and many others) we store our media encrypted on disk. Because of this, vanilla ContentProviders are unavailable as an option as we'd have to write a temporary unencrypted version to disk (ewww). The other option in Fresco would be to setup a localhost HTTP server that streams the unencrypted version (ewwwwww), which is a lot of unnecessary overhead.
If, however, Fresco allowed additional custom Uri handlers that provide InputStreams, we'd be golden. Alternatively, having a setImageInputStream alongside setImageUri would also suffice.
We are thinking of supporting something very similar (basically either a custom uri handler or specifying InputStream Supplier while building image request).
I was going to say exactly the same thing...our app has data stored on disk in encrypted form as well. It's only unencrypted when in the in-memory cache.
Thanks for supporting this soon @plamenko :-)
We also need a way to change the disk data (e.g., user edits a document/photo and writes it to disk, so the cache has to update)...
I'll have to refactor some of the fetching logic to make this plugin-like, but hopefully I'll get to this some time soon.
I'm running into this same issue. I'd like to use this in conjunction with Conceal or another file encryption mechanism which provides an InputStream.
@plamenko is there a timeline on this or any way I can "help" or use an InputStream with the current API? We would like to use in this app https://play.google.com/store/apps/details?id=fm.clean for its internal Gallery.
I`m running into this issue too.
I think we can use content provider.
See http://frescolib.org/docs/supported-uris.html#_
Fresco support "content:" like url.
so we can make a content provider and do decrypt in it at first.
and then set uri "content:xxx?id=xxx&key=xxx" to drawee.
@caojianfeng do you have an example code for that content provider?
@plamenko any update regarding a custom Uri handler?
I don't think we're likely to get to this any time soon. If someone would like to offer a pull request, I'd be willing to offer support.
We're currently cleaning up old issues which aren't progressing but I'll leave this a little longer in case anyone is interested in pursuing this.
Closing this as part of our cleanup of old issues.
If anyone requires this feature, please consider implementing it and submitting a pull request.
I don't think we're likely to get to this any time soon. If someone would like to offer a pull request, I'd be willing to offer support.
As I understand it, nothing was implemented in the end?
Most helpful comment
@caojianfeng do you have an example code for that content provider?