Skip to main content
Participant
June 26, 2024

P: DNG embedded JPEG XL Orientation not set correctly

  • June 26, 2024
  • 4 replies
  • 889 views

The orientation of DNG embedded JPEG XL files ("PreviewJXL") does not seem to be set correctly. The orientation is set in the metadata, but the JPEG XL specification explicitly states that metadata orientation should be ignored and instead be read from the stream: "The Exif orientation should be ignored by applications; the JPEG XL codestream orientation takes precedence and libjxl will by default apply the correct orientation automatically."  (https://github.com/libjxl/libjxl/blob/b7961e1318634a95c7d689ec340dbad8a42d4ed4/lib/include/jxl/decode.h#L1251) So when viewing a JPEG XL preview file, the orientation is wrong unless it's 0.

 

This topic has been closed for replies.

4 replies

Rick Spaulding -
Legend
June 28, 2024

Thanks for reporting this. We were able to reproduce the issue, (thanks, @johnrellis ) and have logged this for the team to investigate.

johnrellis
Legend
June 26, 2024

To make this into an actionable bug report to which Adobe is likely to pay attention, please provide a step-by-step recipe of which software you used to create the DNG, the options used,  and the command line for extracting the JXL SubIFD.  Also, upload a sample raw to Dropbox, Google Drive, or similar and post the sharing link here.  Unless Adobe can easily reproduce the problem, they generally won't pay much attention.

jhhfAuthor
Participant
June 27, 2024

Thanks for the clarification!

 

I'm not sure if I should create a new post in "Bugs" but I'll start by updating this issue with the following:

Lightroom Version: Lightroom Classic 13.4 / Camera Raw 16.4
OS Version: macOS 14.5

Steps to Reproduce:
1. Open Lightroom Classic
2. Import a photo that is taken in "portrait mode" (for example the attached file "test.arw")
3. Export the photo as a DNG file with the option "Use Lossy Compression" enabled
4. Use Exiftool to extract the JPEG XL preview from the DNG file:
exiftool -b -PreviewJXL -w .jxl test.dng
5. Open the JPEG XL preview in an image viewer that supports JPEG XL (for example Safari on Mac) and note that the orientation of the image is incorrect.

Expected result: the JPEG XL preview file shows in "portrait" mode, i.e. the same as the original file.
Actual result: the JPEG XL preview file shows in "landscape" mode, i.e. rotated 90 degrees.
johnrellis
Legend
June 27, 2024
jhhfAuthor
Participant
June 26, 2024

The binary data extracted from the "PreviewJXL" metadata field is a JPEG XL file in the form of a ISOBMFF container. 

 

Example .dng:

https://drive.google.com/file/d/1h5vXA1NTEtjpikeQGaEYEPRlMrizOSep/view?usp=sharing

 

Example .jxl (extracted from the .dng):

https://drive.google.com/file/d/1MWVUUKxYn-XVBSU_f7zqus2RxiMnjZId/view?usp=sharing

 

 

johnrellis
Legend
June 26, 2024

The DNG spec gets to specify how it handles embedded JPEG XL, overriding whatever the JPEG XL spec says. But the DNG 1.7.1 spec says (page 22):

 

"When using JPEG XL to represent a preview IFD, such as a thumbnail or full-resolution rendered preview, it is recommended to use a single tile with the container format [ISO BMFF], so that utilities can extract a readable, standalone JPEG XL file by simply copying the bytes from the IFD."

 

I think that clearly implies that the orientation in the JPEG XL metadata should be correct, so that the extracted JPEG XL file displays correctly.

 

It's too bad that ISO has such an antediluvian, counterproductive policy of charging hundreds of dollars for specs.

Legend
June 26, 2024

I believe they are using JPEG XL compression, not actual JPEG XL files.