*** If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports Please remove this comment after reading and before submitting - thanks! *** SUMMARY JXL images that have been losslessly transcoded from a jpg do not load, regardless of what QT6 based app is used. STEPS TO REPRODUCE 1. Transcode a jpg into a jxl file losslessly 2. Open the file in any QT6 image viewer OBSERVED RESULT The image fails to load EXPECTED RESULT The image loads SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora 41 Kinoite KDE Plasma Version: 6.2.3 KDE Frameworks Version: 6.8.0 Qt Version: 6.8 ADDITIONAL INFORMATION I tested this with YACReader (Flatpak) and Gwenview (Fedora RPMs and Flatpak). To make sure this wasn't a bug with the jxl library, I tested the images that failed to load in Eye Of Gnome (Fedora RPMs), and the images did load. I've also noticed that jxls losslessly converted from PNGs occasionally render as spirals in YACReader. Running Gwenview (Flatpak) from command line opening a transcoded jpg gives the error: "Unexpected event 16384 instead of JXL_DEC_COLOR_ENCODING"
Can you attach a sample image that shows this problem?
Created attachment 175935 [details] Image Converted From PNG To JPG TO JXL
Created attachment 175936 [details] Image Converted From PNG To JXL
Created attachment 175937 [details] Screnshot of opening the file. The left side is Eye of Gnome, the right is Gwenview. Both were installed via Fedora 41's RPMs.
Mirco, can you have a look?
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kimageformats/-/merge_requests/278
Git commit 92a1752c1f72543b6693ee5113b5769b38b5edf4 by Albert Astals Cid, on behalf of Mirco Miranda. Committed on 20/11/2024 at 16:34. Pushed by aacid into branch 'master'. JXL: load error with some lossless file When loading lossless JXL images without ICC profile, the parser failed. The problem was caused by Boxes being enabled (MR !250). The parser should probably be revised to be more flexible. A +- -- autotests/read/jxl/rgb_lossless_noprof.jxl A +- -- autotests/read/jxl/rgb_lossless_noprof.png M +8 -5 src/imageformats/jxl.cpp M +1 -1 src/imageformats/jxl_p.h https://invent.kde.org/frameworks/kimageformats/-/commit/92a1752c1f72543b6693ee5113b5769b38b5edf4
*** Bug 496360 has been marked as a duplicate of this bug. ***
Some animated JXLs still fail to decode with kimageformats 6.9.0: `Unexpected event 16384 instead of JXL_DEC_FRAME` (16384 = JXL_DEC_BOX) The code around https://invent.kde.org/frameworks/kimageformats/-/blob/92a1752c1f72543b6693ee5113b5769b38b5edf4/src/imageformats/jxl.cpp#L361 assumes that all the JXL_DEC_FRAME events are contiguous, but in fact they can interleave with JXL_DEC_BOX. I don't have the example file to share at the moment, but the sequence of decoder events was as follows: JXL_DEC_BOX JXL_DEC_BOX JXL_DEC_BOX JXL_DEC_BASIC_INFO JXL_DEC_COLOR_ENCODING JXL_DEC_BOX JXL_DEC_BOX JXL_DEC_FRAME JXL_DEC_BOX JXL_DEC_FRAME Notice the FRAME - BOX - FRAME sequence at the end, which confuses the `countALLFrames` function.
Created attachment 177007 [details] Animated JXL that fails to decode with kimageformats 6.9.0 Attached an example.
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kimageformats/-/merge_requests/303
Git commit e6a0f8758b5fc62f569635df971e06b8ff9ac365 by Mirco Miranda. Committed on 04/01/2025 at 06:46. Pushed by mircomir into branch 'master'. JXL: Fix missing checks for BOXES when parsing animation Fix error when parsing something like: ``` JXL_DEC_BOX JXL_DEC_BOX JXL_DEC_BOX JXL_DEC_BASIC_INFO JXL_DEC_COLOR_ENCODING JXL_DEC_BOX JXL_DEC_BOX JXL_DEC_FRAME JXL_DEC_BOX JXL_DEC_FRAME ``` A +- -- autotests/read/jxl/bug_496350.jxl A +- -- autotests/read/jxl/bug_496350.png M +28 -10 src/imageformats/jxl.cpp M +1 -0 src/imageformats/jxl_p.h https://invent.kde.org/frameworks/kimageformats/-/commit/e6a0f8758b5fc62f569635df971e06b8ff9ac365
Fixes in KF 6.11