IFF: fix byte swapping in 16-bit DEEP images

This commit is contained in:
Mirco Miranda
2026-05-12 08:21:09 +02:00
parent 6d5e61f0b0
commit 0e2b137b32
7 changed files with 12 additions and 1 deletions

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -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;
}