[graphics/krita] plugins/impex/jxl: Fix imporitng multilayered jpegxl files

Wolthera van Hövell <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit ef113caf57c876325f317e473b98d57babe1d2cd by Wolthera van Hövell, on behalf of Dmitry Kazakov.
Committed on 16/07/2026 at 16:26.
Pushed by woltherav into branch 'master'.

Fix imporitng multilayered jpegxl files

We should not include the final null-termination
character into the final layer name.

M  +3    -1    plugins/impex/jxl/JPEGXLImport.cpp

https://invent.kde.org/graphics/krita/-/commit/ef113caf57c876325f317e473b98d57babe1d2cd

diff --git a/plugins/impex/jxl/JPEGXLImport.cpp b/plugins/impex/jxl/JPEGXLImport.cpp
index b50494edc55..a2f73ab8870 100644
--- a/plugins/impex/jxl/JPEGXLImport.cpp
+++ b/plugins/impex/jxl/JPEGXLImport.cpp
@@ -874,7 +874,9 @@ JPEGXLImport::convert(KisDocument *document, QIODevice *io, KisPropertiesConfigu
                         break;
                     }
                     dbgFile << "\tlayer name:" << QString(layerNameRaw);
-                    layerName = QString(layerNameRaw);
+
+                    // do **not** include the null-termination char into the final layer name
+                    layerName = QString::fromUtf8(layerNameRaw.data(), d.m_header.name_length);
                 } else {
                     layerName = QString("Layer");
                 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.