Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Office
Calligra
Commits
e1b68221
Commit
e1b68221
authored
Nov 03, 2015
by
Halla Rempt
Browse files
BUG:354791 Load the alpha channel correctly
parent
711d996e
Changes
1
Hide whitespace changes
Inline
Side-by-side
krita/plugins/formats/tga/kis_tga_import.cpp
View file @
e1b68221
...
...
@@ -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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment