mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-06-10 01:59:11 -04:00
IFF: fix byte swapping in 16-bit DEEP images
This commit is contained in:
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
BIN
autotests/read/iff/sv5_unc_rgba16_deep.iff
Normal file
BIN
autotests/read/iff/sv5_unc_rgba16_deep.iff
Normal file
Binary file not shown.
BIN
autotests/read/iff/sv5_unc_rgba16_deep.png
Normal file
BIN
autotests/read/iff/sv5_unc_rgba16_deep.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
autotests/read/iff/sv5_unc_rgba8_deep.iff
Normal file
BIN
autotests/read/iff/sv5_unc_rgba8_deep.iff
Normal file
Binary file not shown.
BIN
autotests/read/iff/sv5_unc_rgba8_deep.png
Normal file
BIN
autotests/read/iff/sv5_unc_rgba8_deep.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
@@ -4069,8 +4069,19 @@ QByteArray DBODChunk::strideRead(QIODevice *d, qint32, const DGBLChunk *header,
|
||||
}
|
||||
|
||||
// Uncompressed, Rle and TvDeepCompression: one line at a time.
|
||||
if (rr != size)
|
||||
if (rr != size) {
|
||||
return {};
|
||||
}
|
||||
|
||||
// byte swap
|
||||
if (auto count = pel->count()) {
|
||||
if (pel->depth() / count == 16) {
|
||||
for (auto x = 0, w = qint32(planes.size()) - 1; x < w; x += 2) {
|
||||
std::swap(planes[x], planes[x + 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return planes;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user