does not extract EXIF metadata from JpegXL file

Started by breunigs, May 18, 2023, 02:02:00 AM

Previous topic - Next topic

breunigs

Hi,

pointing exiftool 12.62 on a Linux at source.JPG file prints the expected EXIF metadata. After converting the image to JXL using cjxl --lossless_jpeg=1 source.JPG convert.jxl only file metadata is reported using exiftool -All convert.jxl. I am sure the jxl file still contains the EXIF, since exiv2 -p a convert.jxl can properly display it (make sure you grab an exiv2 version built with brotli).

Output for exiftool -v3:
  ExifToolVersion = 12.62
  FileName = convert.jxl
  Directory = .
  FileSize = 2059488
  FileModifyDate = 1684388358
  FileAccessDate = 1684388358
  FileInodeChangeDate = 1684388358
  FilePermissions = 33188
  FileType = JXL
  FileTypeExtension = JXL
  MIMEType = image/jxl
  + [JP2 directory]
  | FileType (SubDirectory) -->
  | - Tag 'ftyp' (12 bytes):
  |     0014: 6a 78 6c 20 00 00 00 00 6a 78 6c 20             [jxl ....jxl ]
  | + [BinaryData directory, 12 bytes]
  | | MajorBrand = jxl
  | | - Tag 0x0000 (4 bytes, undef[4]):
  | |     0014: 6a 78 6c 20                                     [jxl ]
  | | MinorVersion =
  | | - Tag 0x0001 (4 bytes, undef[4]):
  | |     0018: 00 00 00 00                                     [....]
  | | CompatibleBrands = jxl
  | | - Tag 0x0002 (4 bytes, undef[4]):
  | |     001c: 6a 78 6c 20                                     [jxl ]
  | Jpeg2000_jxlp = ...]..
  | - Tag 'jxlp' (10 bytes):
  |     0028: 00 00 00 00 ff 0a ba 5d 03 91                   [.......]..]
  | Jpeg2000_jbrd = Bq..N.4..,@.Q....rT.`(..."c.2.)..G..f...3P.C....'.3......4...QC...2[snip]
  | - Tag 'jbrd' (126362 bytes):
  |     003a: 42 71 03 88 4e cb 34 ef 81 2c 40 a0 51 00 e4 aa [Bq..N.4..,@.Q...]
  |     004a: 12 00 00 10 72 54 b6 60 28 ce ff 01 22 63 84 32 [....rT.`(..."c.2]
  |     005a: ce 29 05 ed 47 c8 10 66 a9 83 0c 33 50 ba 43 0d [.)..G..f...3P.C.]
  |     006a: d6 87 0c 27 1f 33 e0 90 83 0a 8b 1c 34 ec c0 f6 [...'.3......4...]
  |     007a: 51 43 ff fe c8 32 87 1d 77 a0 a1 e8 fe 17 63 9c [QC...2..w.....c.]
  |     [snip 126282 bytes]
  | Jpeg2000_brob = Exif.......4R........+fL*.M.^U..< K.e...U...mv..*.1.c...;.o.\....se[snip]
  | - Tag 'brob' (4619 bytes):
  |    1eddc: 45 78 69 66 1b ee 1e 11 d5 b4 1e 00 34 52 16 ce [Exif........4R..]
  |    1edec: df ef cf b6 de f0 2b 66 4c 2a 0a 4d 02 5e 55 aa [......+fL*.M.^U.]
  |    1edfc: c6 3c 20 4b 83 65 d1 aa 1e 55 ae 1d a0 6d 76 94 [.< K.e...U...mv.]
  |    1ee0c: 08 2a 8a 31 b1 63 0e b0 0b 3b f6 6f ad 5c 1a 0b [.*.1.c...;.o.\..]
  |    1ee1c: b1 1b 73 65 a2 33 73 69 74 4c b1 72 51 fe fc b1 [..se.3sitL.rQ...]
  |     [snip 4539 bytes]
  | Jpeg2000_jxlp = ...[..L.?.`.,`;..E......B.3.5.t.1.}...|R..y....Y..R...y.OPr.~.....6[snip]
  | - Tag 'jxlp' (1928433 bytes):
  |    1ffef: 80 00 00 01 e0 5b 04 10 00 4c ec 3f 1f 60 fb 2c [.....[...L.?.`.,]
  |    1ffff: 60 3b 0b a0 45 0b 90 fe 93 11 91 42 10 33 90 35 [`;..E......B.3.5]
  |    2000f: 90 74 d0 31 91 7d d0 ec d1 7c 52 9f d3 79 9a 15 [.t.1.}...|R..y..]
  |    2001f: db eb 59 e4 98 52 98 cc 94 79 95 4f 50 72 90 7e [..Y..R...y.OPr.~]
  |    2002f: 10 88 90 e4 10 36 11 a0 11 5f 91 5b 93 e0 db 93 [.....6..._.[....]
  |     [snip 1928353 bytes]

Thank you
Stefan

greybeard

Looks like cjxl compresses up the EXIF metadata (with the Brotli algorithm) and stores it in the "brob" box  instead of the Exif box which would presumably be uncompressed.

Phil Harvey

Thanks for this report, and for the example.  I'll look into this when I get a chance.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

#3
Hmmm.  Unfortunately there isn't a simple Brotli decompressor module for Perl to decode the 'brob' box.  It looks like I would have to write one myself.  Edit: Found one!

My development will be hampered by this, as well as the fact that the JXL file format specification is imprisoned by the ISO.  :( :(

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

I have a working version of ExifTool which can read the image size from partial JXL codestreams and read/write/create compressed 'brob' XMP and EXIF metadata.

I need to do more testing, but it is looking good for inclusion in ExifTool 12.63

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Version 12.63 is now available.  Reading/writing 'brob' metadata requires IO::Compress::Brotli to be installed.  (This is included in the Windows .exe package, but would need to be installed separately on Mac/Linux.)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).