Bug 464406 - JPEG-XL reader does not read rotation information
Summary: JPEG-XL reader does not read rotation information
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kimageformats
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.102.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alex Merry
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-17 13:06 UTC by Christoph Feck
Modified: 2024-09-30 21:00 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Feck 2023-01-17 13:06:13 UTC
JPEG-XL images that have rotation ("jxlinfo image.jxl | grep orientation") are not loaded correctly rotated, despite autoRotation() enabled.

STEPS TO REPRODUCE
1. find a JPEG image that has EXIF rotation
2. encode to JPEG-XL with "cjxl image.jpg image.jpg.jxl"
3. view both images with a KDE/Qt viewer

OBSERVED RESULT
The rotation is different between the images.

EXPECTED RESULT
The transformation() information is set correctly via QImageIOHandler::setOption() to automatically rotate the JPEG-XL image.

SOFTWARE/OS VERSIONS
KDE Frameworks Version: 5.102
Qt Version: 5.15.8
Comment 1 dnovomesky 2023-01-17 13:17:17 UTC
Can you send me:

Original JPG images?

The converted JXL file?

Info what viewer/version are you using?

Version of libjxl?
Comment 2 Mirco Miranda 2024-09-30 21:00:29 UTC
Orientation is supported by the JXL plugin and is part of the CI tests (https://invent.kde.org/frameworks/kimageformats/-/tree/master/autotests/read/jxl?ref_type=heads).

Orientation is natively supported by the JXL code stream and, by specification, the fields present in the code stream have precedence over the same ones present in the EXIF ​​metadata (which by the way is strongly recommended to have them consistent). So even in this case the plugin behaves correctly (EXIF is not supported anyway).

If the problem is the lack of Qt transform option (the image was always transformed following the orientation even if not requested), the problem has been solved by MR !233 (https://invent.kde.org/frameworks/kimageformats/-/merge_requests/233).

If you still encounter the issue, please reopen this bug report attaching the JXL image.