summaryrefslogtreecommitdiffstats
path: root/src/plugins/imageformats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-26 01:00:13 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-26 01:00:13 +0200
commit0dff40adf81d0bc2023c109abf266053431bfcd0 (patch)
tree85776cb125584759b706f45f1465bd5d3d9ccfe4 /src/plugins/imageformats
parent7db9e02ad11c391c1d616defd11e7deb2718d60a (diff)
parent913dd26c92f406e3da83ed83701ce47e659bcc48 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'src/plugins/imageformats')
-rw-r--r--src/plugins/imageformats/ico/qicohandler.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp
index 30935cacda..4908850cc5 100644
--- a/src/plugins/imageformats/ico/qicohandler.cpp
+++ b/src/plugins/imageformats/ico/qicohandler.cpp
@@ -523,17 +523,21 @@ QImage ICOReader::iconAt(int index)
if (!image.isNull()) {
readBMP(image);
if (!image.isNull()) {
- QImage mask(image.width(), image.height(), QImage::Format_Mono);
- if (!mask.isNull()) {
- mask.setColorCount(2);
- mask.setColor(0, qRgba(255,255,255,0xff));
- mask.setColor(1, qRgba(0 ,0 ,0 ,0xff));
- read1BitBMP(mask);
+ if (icoAttrib.depth == 32) {
+ img = std::move(image).convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ } else {
+ QImage mask(image.width(), image.height(), QImage::Format_Mono);
if (!mask.isNull()) {
- img = image;
- img.setAlphaChannel(mask);
- // (Luckily, it seems that setAlphaChannel() does not ruin the alpha values
- // of partially transparent pixels in those icons that have that)
+ mask.setColorCount(2);
+ mask.setColor(0, qRgba(255,255,255,0xff));
+ mask.setColor(1, qRgba(0 ,0 ,0 ,0xff));
+ read1BitBMP(mask);
+ if (!mask.isNull()) {
+ img = image;
+ img.setAlphaChannel(mask);
+ // (Luckily, it seems that setAlphaChannel() does not ruin the alpha values
+ // of partially transparent pixels in those icons that have that)
+ }
}
}
}