EXIF and XML metadata not extracted from JPEG XL(JXL) image file with brotli compressed metadata #1647

Closed
opened 2026-02-05 02:51:16 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @amitrea on GitHub (Nov 19, 2023).

Issue

First of all thank you for the great work!

I currently have all my images in JPEG XL(JXL) format with all metadata (EXIF,XMP, etc.) in Brotli compress containers as per specification.

Immich is using exiftool-vendored package (v12.67.0) which in turn is using exiftool v.12.67.0.

Exiftool added support for reading brotli compressed metadata from JXL files since version v.12.63.0. Please see it in the release history (https://exiftool.org/history.html). I quote: "Added ability to read/write/create Brotli-compressed metadata in JXL images (requires IO::Compress::Brotli)".

The current exiftool version that Immich is using is supporting reading EXIF and XML metadata written in JXL Brotli compress containers, but in order to work, as specified in release notes of Exiftool v.12.63, it requires Perl module "IO::Compress::Brotli" which is not installed in any Debian/Alpine Docker Immich version.

Output of exiftool - within the docker container

$ /usr/src/app/node_modules/exiftool-vendored.pl/bin/exiftool -a -u -G0:1 -s -ee /usr/src/app/upload/library/admin/20210312_092005_85E9EE0C.jxl

[ExifTool]      ExifToolVersion                 : 12.67
[ExifTool]      Warning                         : Install IO::Uncompress::Brotli to decode Brotli-compressed metadata
[File:System]   FileName                        : 20210312_092005_85E9EE0C.jxl
[File:System]   Directory                       : /usr/src/app/upload/library/admin
[File:System]   FileSize                        : 3.9 MB
[File:System]   FileModifyDate                  : 2023:11:19 09:45:11+00:00
[File:System]   FileAccessDate                  : 2023:11:19 09:55:39+00:00
[File:System]   FileInodeChangeDate             : 2023:11:19 09:50:26+00:00
[File:System]   FilePermissions                 : -rw-r-----
[File]          FileType                        : JXL
[File]          FileTypeExtension               : jxl
[File]          MIMEType                        : image/jxl
[File]          ImageWidth                      : 5120
[File]          ImageHeight                     : 3840
[Jpeg2000]      MajorBrand                      : JPEG XL Image (.JXL)
[Jpeg2000]      MinorVersion                    : 0.0.0
[Jpeg2000]      CompatibleBrands                : jxl
[Composite]     ImageSize                       : 5120x3840
[Composite]     Megapixels                      : 19.7

The second line of exiftool, the Warning, clearly shows the issue.

Output of jxlinfo tool - outside of Docker container

$ jxlinfo -v /media/20210312_092005_85E9EE0C.jxl

box: type: "JXL " size: 12
JPEG XL file format container (ISO/IEC 18181-2)
box: type: "ftyp" size: 20
box: type: "jxlp" size: 18
JPEG XL image, 5120x3840, (possibly) lossless, 8-bit RGB
num_color_channels: 3
num_extra_channels: 0
have_preview: 0
have_animation: 0
Intrinsic dimensions: 5120x3840
Orientation: 1 (Normal)
box: type: "jbrd" size: 489
JPEG bitstream reconstruction data available
box: type: "brob" size: 38432
Brotli-compressed Exif metadata: 38432 compressed bytes
box: type: "brob" size: 384
Brotli-compressed xml  metadata: 384 compressed bytes
box: type: "jxlp" size: 3828361
Color space: RGB, D65, sRGB primaries, sRGB transfer function, rendering intent: Relative

It can be noticed that EXIF and XML metadata are Brotli compressed

Version of Immich Server

v1.87.0

Impact

The only relevant datetime metadata of JXL image that immich can take is "FileModifyDate" but this does not guarantee that it is the same with "EXIF:DateTimeOriginal", thereby can mess up the timeline.

Editing metadata for JXL files will not be possible.

Searching images by metadata will be useless, in absence of EXIF and XML metadata.

Why JXL

Here - https://jpegxl.info/why-jxl.html - to find the more about royalty-free JPEG-XL format.

Reproduction steps

  1. JXL library/tools need to be installed on your local or server computer - libjxl or libjxl-tools.
  2. Create a JPEG XL image from an existing JPEG
    cjxl --lossless_jpeg=1 ./media/20150606_104312_42C01D17.jpg ./media/20150606_104312_42C01D17.jxl
  3. Make sure that the created JXL file has EXIF metadata compressed.
    $ jxlinfo -v /media/20210312_092005_85E9EE0C.jxl

You should see that EXIF metadata is brotli compressed, similar with the output above

  1. Make the JXL image available to immich-server or immich-microservices Docker instance.
  2. Log into immich-microservices container.
  3. Print the JXL file EXIF metadata as I did above.
    $ /usr/src/app/node_modules/exiftool-vendored.pl/bin/exiftool -a -u -G0:1 -s -ee jxl_file_location

The output should show the Warning: "Install IO::Uncompress::Brotli to decode Brotli-compressed metadata".

Current Workaround

I installed the Perl module IO::Compress::Brotli in both immich-server and immich-microservices after running docker compose.

For Debian image:

$ apt install -y build-essential openssl libssl-dev zlib1g-dev cpanminus
...
$ cpanm IO:Compres::Brotli 
...
$ /usr/src/app/node_modules/exiftool-vendored.pl/bin/exiftool -a -u -G0:1 -s -ee jxl_file_location

For Alpine image:

$ apk add --no-cache --virtual build-dependencies openssl openssl-dev build-base gcc cmake zlib-dev libjxl perl perl-dev perl-app-cpanminus perl-alien-build
...
$ cpanm IO:Compres::Brotli
...
$ /usr/src/app/node_modules/exiftool-vendored.pl/bin/exiftool -a -u -G0:1 -s -ee jxl_file_location

The last exiftool command should show the full EXIF and XML metadata
In browser Immich app, clicking on image JXL info can see more metadata.

Originally created by @amitrea on GitHub (Nov 19, 2023). ### Issue First of all thank you for the great work! I currently have all my images in JPEG XL(JXL) format with all metadata (EXIF,XMP, etc.) in Brotli compress containers as per specification. Immich is using exiftool-vendored package (v12.67.0) which in turn is using exiftool v.12.67.0. Exiftool added support for reading brotli compressed metadata from JXL files since version v.12.63.0. Please see it in the release history (https://exiftool.org/history.html). I quote: "Added ability to read/write/create Brotli-compressed metadata in JXL images (requires IO::Compress::Brotli)". The current exiftool version that Immich is using is supporting reading EXIF and XML metadata written in JXL Brotli compress containers, but in order to work, as specified in release notes of Exiftool v.12.63, it requires Perl module "IO::Compress::Brotli" which is not installed in any Debian/Alpine Docker Immich version. ### Output of exiftool - within the docker container ``` $ /usr/src/app/node_modules/exiftool-vendored.pl/bin/exiftool -a -u -G0:1 -s -ee /usr/src/app/upload/library/admin/20210312_092005_85E9EE0C.jxl [ExifTool] ExifToolVersion : 12.67 [ExifTool] Warning : Install IO::Uncompress::Brotli to decode Brotli-compressed metadata [File:System] FileName : 20210312_092005_85E9EE0C.jxl [File:System] Directory : /usr/src/app/upload/library/admin [File:System] FileSize : 3.9 MB [File:System] FileModifyDate : 2023:11:19 09:45:11+00:00 [File:System] FileAccessDate : 2023:11:19 09:55:39+00:00 [File:System] FileInodeChangeDate : 2023:11:19 09:50:26+00:00 [File:System] FilePermissions : -rw-r----- [File] FileType : JXL [File] FileTypeExtension : jxl [File] MIMEType : image/jxl [File] ImageWidth : 5120 [File] ImageHeight : 3840 [Jpeg2000] MajorBrand : JPEG XL Image (.JXL) [Jpeg2000] MinorVersion : 0.0.0 [Jpeg2000] CompatibleBrands : jxl [Composite] ImageSize : 5120x3840 [Composite] Megapixels : 19.7 ``` **The second line of exiftool, the Warning, clearly shows the issue.** ### Output of jxlinfo tool - outside of Docker container ``` $ jxlinfo -v /media/20210312_092005_85E9EE0C.jxl box: type: "JXL " size: 12 JPEG XL file format container (ISO/IEC 18181-2) box: type: "ftyp" size: 20 box: type: "jxlp" size: 18 JPEG XL image, 5120x3840, (possibly) lossless, 8-bit RGB num_color_channels: 3 num_extra_channels: 0 have_preview: 0 have_animation: 0 Intrinsic dimensions: 5120x3840 Orientation: 1 (Normal) box: type: "jbrd" size: 489 JPEG bitstream reconstruction data available box: type: "brob" size: 38432 Brotli-compressed Exif metadata: 38432 compressed bytes box: type: "brob" size: 384 Brotli-compressed xml metadata: 384 compressed bytes box: type: "jxlp" size: 3828361 Color space: RGB, D65, sRGB primaries, sRGB transfer function, rendering intent: Relative ``` **It can be noticed that EXIF and XML metadata are Brotli compressed** ### Version of Immich Server v1.87.0 ### Impact The only relevant datetime metadata of JXL image that immich can take is "FileModifyDate" but this does not guarantee that it is the same with "EXIF:DateTimeOriginal", thereby can mess up the timeline. Editing metadata for JXL files will not be possible. Searching images by metadata will be useless, in absence of EXIF and XML metadata. ### Why JXL Here - https://jpegxl.info/why-jxl.html - to find the more about royalty-free JPEG-XL format. ### Reproduction steps 1. JXL library/tools need to be installed on your local or server computer - libjxl or libjxl-tools. 2. Create a JPEG XL image from an existing JPEG `cjxl --lossless_jpeg=1 ./media/20150606_104312_42C01D17.jpg ./media/20150606_104312_42C01D17.jxl` 3. Make sure that the created JXL file has EXIF metadata compressed. `$ jxlinfo -v /media/20210312_092005_85E9EE0C.jxl` **You should see that EXIF metadata is brotli compressed, similar with the output above** 4. Make the JXL image available to immich-server or immich-microservices Docker instance. 5. Log into immich-microservices container. 6. Print the JXL file EXIF metadata as I did above. `$ /usr/src/app/node_modules/exiftool-vendored.pl/bin/exiftool -a -u -G0:1 -s -ee jxl_file_location` **The output should show the Warning: "Install IO::Uncompress::Brotli to decode Brotli-compressed metadata".** ### Current Workaround I installed the Perl module IO::Compress::Brotli in both immich-server and immich-microservices after running docker compose. For Debian image: ``` $ apt install -y build-essential openssl libssl-dev zlib1g-dev cpanminus ... $ cpanm IO:Compres::Brotli ... $ /usr/src/app/node_modules/exiftool-vendored.pl/bin/exiftool -a -u -G0:1 -s -ee jxl_file_location ``` For Alpine image: ``` $ apk add --no-cache --virtual build-dependencies openssl openssl-dev build-base gcc cmake zlib-dev libjxl perl perl-dev perl-app-cpanminus perl-alien-build ... $ cpanm IO:Compres::Brotli ... $ /usr/src/app/node_modules/exiftool-vendored.pl/bin/exiftool -a -u -G0:1 -s -ee jxl_file_location ``` **The last exiftool command should show the full EXIF and XML metadata** **In browser Immich app, clicking on image JXL info can see more metadata.**
Author
Owner

@jrasm91 commented on GitHub (Nov 26, 2023):

Fixed with https://github.com/immich-app/base-images/pull/14

@jrasm91 commented on GitHub (Nov 26, 2023): Fixed with https://github.com/immich-app/base-images/pull/14
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1647