Support JPEG XL images

9
closed
xiota
xiota
Posted 7 months ago

Support JPEG XL images #900

Feature request to support viewing JPEG XL images

The ISO standardization of JPEG XL is still in progress, but the read API of the libjxl reference implementation is reportedly stable. So it would be reasonable to add support to Geeqie to display JXL images.

JXL already has support in Firefox (nightly builds) and Google Chrome (in stable builds, but disabled by default).

caclark
caclark
Created 7 months ago

In the latest commit there is the possibility to include an external preview image decoder/extractor. It is on Edit/Preferences/Advanced. The Help file includes a hint of how to use it.

I viewed jxl files using two shell scripts -

Identify: #! /bin/bash filename=$(basename -- "$1") extension="${filename##*.}" if [[ $extension == "jxl" ]] then exit 0 else exit 1 fi

Decode: #! /bin/bash output=$(mktemp --tmpdir geeqie_djxl_XXXXXX.jpg) $HOME/bin/libjxl/build/tools/djxl "$1" $output mv $output "$2"

xiota
xiota
Created 7 months ago

Thanks for providing this.

Minor issue... Geeqie apparently doesn't use metadata from the preview image. JPEG XL files contain Exif metadata that djxl copies to the output files. Would be nice if Geeqie could show that metadata.

caclark
caclark
Created 7 months ago

For this example image, I see the data in the View/Exif Window

Are you outputting to a jpg format?

xiota
xiota
Created 7 months ago

I copied and pasted the sample scripts you provided. Confirmed the jxl file and djxl output contain metadata using ExifTool 12.26. Here's a screenshot showing metadata doesn't show.

screenshot

caclark
caclark
Created 7 months ago

This maybe, possibly, due to the version of exiv2 in use. The system I am using has exiv2 0.27.4.2

xiota
xiota
Created 7 months ago

I updated exiv2 to 0.27.4.3 and rebuilt geeqie. It still doesn't show metadata for jxl files that are viewed via jpg provided by the external decoder script.

caclark
caclark
Created 7 months ago

Ah, sorry... I think this may be related to a solution I found when looking at another problem (and had forgotten about). Try to compile exiv2 with BMFF support:

cmake .. -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_BMFF=On

xiota
xiota
Created 7 months ago

Thanks. Displaying metadata works after... Recompiling exiv2 with -DEXIV2_ENABLE_BMFF=On... and rebuilding geeqie.

Should this issue be left open for when JPEG XL standardization is complete, in case you decide to use libjxl someday?

caclark
caclark
Created 5 months ago

If you are compiling from sources, you will need to compile and install libjxl for yourself.

An alternative is to use the latest Geeqie AppImage (from the downloads section of geeqie.org) - libjxl is included in the binary.