Bug 505609 - 8bit JXL images with alpha have no transparency [patch]
Summary: 8bit JXL images with alpha have no transparency [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-QImage (other bugs)
Version First Reported In: 8.7.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-14 21:36 UTC by Eugene Vert
Modified: 2025-06-15 06:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 8.7.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Vert 2025-06-14 21:36:44 UTC
SUMMARY
QImage plugin ignores transparency of 8 bit images with alpha channel.

STEPS TO REPRODUCE
1. Add JXL 8 bit image with transparency to library
2. Open the image with digiKam/showFoto

SOFTWARE/OS VERSIONS
Linux: openSUSE Tumbleweed
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
From Qt 5.15 documentation: "QColor::QColor(QRgb color) Constructs a color with the value color. The alpha component is ignored and set to solid."

Suggested patch:
```patch
diff --git a/core/dplugins/dimg/qimage/dimgqimageloader_load.cpp b/core/dplugins/dimg/qimage/dimgqimageloader_load.cpp
index 705597d8d..83491f38e 100644
--- a/core/dplugins/dimg/qimage/dimgqimageloader_load.cpp
+++ b/core/dplugins/dimg/qimage/dimgqimageloader_load.cpp
@@ -146,7 +146,7 @@ bool DImgQImageLoader::load(const QString& filePath, DImgLoaderObserver* const o

         for (uint i = 0 ; i < w * h ; ++i)
         {
-            QColor color(*sptr);
+            QColor color = QColor::fromRgba(*sptr);
             dptr[0] = color.blue();
             dptr[1] = color.green();
             dptr[2] = color.red();
```
Comment 1 Maik Qualmann 2025-06-15 06:19:25 UTC
Git commit fd83243e261282500a73feac8f72d0209a4ba8e0 by Maik Qualmann.
Committed on 15/06/2025 at 06:18.
Pushed by mqualmann into branch 'master'.

apply patch from Eugene Vert to fix alpha channel of 8bit QImage loading
FIXED-IN: 8.7.0

M  +1    -1    NEWS
M  +5    -5    core/dplugins/dimg/qimage/dimgqimageloader_load.cpp

https://invent.kde.org/graphics/digikam/-/commit/fd83243e261282500a73feac8f72d0209a4ba8e0