[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [calligra/calligra/2.9] krita/plugins/formats/tga: BUG:354791 Load the alpha channel correctly
From: Boudewijn Rempt <boud () valdyas ! org>
Date: 2015-11-03 17:26:03
Message-ID: E1ZtfLP-00007u-Hr () scm ! kde ! org
[Download RAW message or body]
Git commit e1b6822170a149b87de52a933920d955c450854a by Boudewijn Rempt.
Committed on 03/11/2015 at 17:12.
Pushed by rempt into branch 'calligra/2.9'.
BUG:354791 Load the alpha channel correctly
M +8 -4 krita/plugins/formats/tga/kis_tga_import.cpp
http://commits.kde.org/calligra/e1b6822170a149b87de52a933920d955c450854a
diff --git a/krita/plugins/formats/tga/kis_tga_import.cpp \
b/krita/plugins/formats/tga/kis_tga_import.cpp index 21cbd5e..d6213ea 100644
--- a/krita/plugins/formats/tga/kis_tga_import.cpp
+++ b/krita/plugins/formats/tga/kis_tga_import.cpp
@@ -67,9 +67,13 @@ static QDataStream & operator>> (QDataStream & s, TgaHeader & \
head) s >> head.pixel_size;
s >> head.flags;
- /*qDebug() << "id_length: " << head.id_length << " - colormap_type: " << \
head.colormap_type << " - image_type: " << head.image_type;
- qDebug() << "colormap_index: " << head.colormap_index << " - colormap_length: " \
<< head.colormap_length << " - colormap_size: " << \
head.colormap_size;
- qDebug() << "x_origin: " << head.x_origin << " - y_origin: " << head.y_origin << \
" - width:" << head.width << " - height:" << head.height << " - pixelsize: " << \
head.pixel_size << " - flags: " << head.flags;*/ + qDebug() << "id_length: " << \
head.id_length << " - colormap_type: " << head.colormap_type + << " - \
image_type: " << head.image_type; + qDebug() << "colormap_index: " << \
head.colormap_index << " - colormap_length: " + << head.colormap_length \
<< " - colormap_size: " << head.colormap_size; + qDebug() << "x_origin: " << \
head.x_origin << " - y_origin: " << head.y_origin + << " - width:" << \
head.width << " - height:" << head.height + << " - pixelsize: " << \
head.pixel_size << " - flags: " << head.flags;
return s;
}
@@ -225,7 +229,7 @@ static bool loadTGA(QDataStream & s, const TgaHeader & tga, \
QImage &img) } else if (tga.pixel_size == 32) {
for (int x = 0; x < tga.width; x++) {
// ### TODO: verify with images having really some alpha data
- const uchar alpha = (src[3] << (8 - numAlphaBits));
+ const uchar alpha = src[3];
scanline[x] = qRgba(src[2], src[1], src[0], alpha);
src += 4;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic