JPEG XL

Info

rules 58
github 38692
reddit 688

JPEG XL

jxl-rs 0
tools 4270
website 1813
adoption 22069
image-compression-forum 0
glitch-art 1071

General chat

welcome 3957
introduce-yourself 294
color 1687
photography 3532
other-codecs 25116
on-topic 26652
off-topic 23987

Voice Channels

General 2578

Archived

bot-spam 4577

Metadata not included in djxl output for cjxl -j or cjxl -d 1

Deleted User
_wb_ https://github.com/libjxl/libjxl/issues/540 lol
2021-09-05 12:30:57
_wb_
2021-09-05 04:41:07
Ah
2021-09-05 04:45:44
For Exif, there's another issue: if you have e.g. a 90 degree oriented JPEG and losslessly transcode it to jxl, then the jxl will have the orientation in the jxl codestream header, but also in the Exif. When decoding to pixels, the Exif is ignored and we use the codestream header to properly orient the image (this allows you to just strip all Exif if you want, without getting a wrongly oriented image).
2021-09-05 04:46:44
When djxl writes a lossy transcoded jpeg, it first decodes to pixels, and then encodes those pixels in jpeg
2021-09-05 04:47:54
So it does orient the pixels and produces a jpeg that is already oriented (not like the original jpeg that needed exif to be oriented)
2021-09-05 04:48:57
That's fine, but if we would now just add the Exif to that jpeg, then viewers would orient the jpeg again, causing it to be rotated 180 degrees instead of 90
2021-09-05 04:50:44
One possible solution could be to not orient decoded pixels if we know we're going to write a jpeg and we're going to add Exif
2021-09-05 04:51:23
Another solution would be to change the Exif we write to do no orientation.
2021-09-05 09:32:37
To be honest, I don't really know why djxl supports writing a lossy jpeg at all. It's not really its job to be a jpeg encoder.
2021-09-05 09:33:05
It would be convenient if djxl would let you extract metadata though
2021-09-05 09:33:41
Like imagemagick does, you can do `convert foo.jpg foo.exif` to get the embedded exif blob
2021-09-05 09:34:04
We could make `djxl` do that too quite easily
2021-09-06 01:21:47
made some progress on handling exif in a better way: https://github.com/libjxl/libjxl/pull/544