Closed schrmh closed 1 year ago
Thanks for the report. It is indeed broken, possibly due to this change in imlib2: https://git.enlightenment.org/old/legacy-imlib2/commit/5b357a815b34487e70505e9b1a1b215fad6dcf9c
I thought this loader might have outlived its usefulness, so I haven't been giving it much attention, but I'll see if I can get it working again.
Thanks, it would be good to have something for saving since there is actually imlib2 using software able to save in other formats but not JXL (e.g. scrot).
Best thing would be to have it upstream instead of a separate thing one needs to install but since it looks like this thing here provided more (by not ignoring color profile), it might be good to fix this first and then try to advocate kw to take some code from here.
Rightly or wrongly, loaders all seem to ignore color profiles, so my guess is they won't want to start handling it upstream now, especially if it adds a dependency on lcms2.
My loader is arbitrarily converting everything to JXL's default sRGB profile, which isn't even necessarily correct - it's just more consistent than ignoring the profile completely. Since I first wrote that, a new JxlDecoderSetPreferredColorProfile
has been added to the libjxl API, which for some images (most lossy ones), can achieve the same thing without needing a separate CMS library. So that might be a worthwhile addition to their _load
function (and mine too).
By the time the lcms stuff is stripped out, and the code is refactored to the new API, and brought in line with imlib2 coding standards... there won't be much left. Looking at their license, I'm also unsure whether they can accept ~MIT~ BSD-licensed code (although if they really wanted it, I'd be willing to donate it with no strings attached).
So I suspect they won't be interested in integrating any of my code. The best way forward is probably to lobby the imlib2 folks to add the few lines needed for a _save
function.
It should be working with the latest imlib2 now. Verified using the imlib2-jxl-git from AUR. It breaks compatibility with older imlib2s, so the 0.1.1 release will still be needed for those.
By the way: kw actually added a saver just a few days after you (did not notice this until now): https://git.enlightenment.org/old/legacy-imlib2/commit/a55f36133d575a46a19d45718b81378078085037
However, that thing with ignoring color profiles seems to be still a thing I guess.
I build it and also tried the AUR package. With that new jxl.so in /usr/lib/imlib2/loaders/, I always get this when I try to open a JXL by using
feh
:I noticed the new jxl.so has no execute permissions set on it — in contrast to the other loaders — but even when I set that manually, it doesn't work. Of course, when I move the native jxl.so back in place, feh displays the JXL.