Support for more image formats (including TIF and PSD)#365
Conversation
It works in dev mode, but the packaged version cannot load the native sharp module yet - Completed support for .tiff files and a bunch of other formats like exr (#279) - Added partial support for .psd and .kra files (#361). Only the thumbnail is loaded - Cache extracted full images (e.g. for tiff) so it doesn't need to be converted repeatedly - Added WIP panel to settings for disabling file formats
…without-native-deps
…o more-image-formats-without-native-deps
…o more-image-formats-without-native-deps
…Loader.getImgSrc with forceNoThumbnail)
|
👍 🏅 Lookin good! Ready to merge imo |
|
Actually, I accidentially pushed my changes 😂 The only thing left I wanted to try out was using the usePromise hook in the gallery item because it tends to just show an error when loading for the first to three times. Btw I think I've got basic rgba exr loading on my machine in only 400KB WASM lol However, I had to turn off multi threading, so it's crawling in comparison to native. I think tif and exr loader should be put in its own thread because it otherwise it blocks the Promises. |
|
This adds experimental support for exr files using the exr-rs crate. The crate is surprisingly featureful with the exception of deep data and dwab decrompression. So, far the code only handles rgba files and converts it to srgb (I think Electron cannot display hdr images anyways). Adding support for Lab or YCbCr should be possible. Worst case I convert everything to rgba :) Before the next release we need to put the loaders in a worker because it is really slow right now. I could make the color conversion faster with SIMD but before that we need to figure out how to upgrade Electron. |
|
awesome, it works great for a few sample EXR images I found. Didn't notice any real performance issues |
|
TODO: Prevent creating multiple tasks for same images while generating. |
…o more-image-formats-without-native-deps
…ub.com/allusion-app/Allusion into more-image-formats-without-native-deps
I'm just merging it now since it has some nice goodies. Users can disable EXR support if they experience problems so it should be fine |
Added support for more image formats
Also added a new settings panel for selectively disabling formats by file extension
This has been a long time coming. At first I tried to get OpenImageIO to work, which would be able to read pretty much any file format. This ended up taking very long, so I gave in and went with Sharp for just getting TIF support, which worked nicely, but not in the packaged Electron version. In the end I just went with a javascript-only library: UTIFF (used by Photopea).
For PSDs, the thumbnail is extracted using exiftool, which only produces a low res thumbnail, but it's better than nothing. If you don't want it, you can just disable it in the settings. For KRA, the file can be parsed as a zip file which contains a thumbnail. It contains a full-size image we could use as well if we want
allusion-more-media-formats.mp4