apps
apps copied to clipboard
Universal image decoder
This is the next issue in my series of Things that Modern Web Browsers Inexplicably Suck at: supporting image formats less than a couple of decades old. Exhibit A.
Fortunately, it's now possible to fix these deficiencies with JS (albeit with some performance penalty). This is important for IPFS apps (e.g. #2), as we can't rely on a backend server to be available to perform on-demand image conversion --- it all has to be done either ahead of time (costly), or within the browser itself.
Here's what I'd like. You include something like
<script src="img.js"></script>
which automatically detects any img tags referencing unsupported formats, loads the appropriate decoder, and seamlessly splices the result into the page (like bpgdec.js does). Bonus points for:
- not just decoding images on page load, but also after dynamic DOM modifications (necessary for #2)
- progressively rendering images, to offset the overhead of decoding in JS (i.e. quickly render a low-quality version, then work on rendering the high-quality version)
Also see:
- jonsneyers/FLIF#21
Yep, entirely agreed. This is TRTTD. by hosting all the decoders on ipfs, we can leverage local caching.
I think one interesting thing to do might be to have the output of the js codecs be saved back to ipfs, under some link like .../<new-fmt>/<orgiinal-hash>.<ext> that the local client can create and store. that way the images get computed once locally. (can't do this and trust the product externally, but maybe could have trusted format recorder build farms that do the same thing)