TIM: fix 16BPP on big-endian

Despite the QImage::scanLine doc only warning about byte order issues
for 32-bpp formats[0] the same warning seems to apply to 16BPP formats
like QImage::Format_RGB555 as well.

[0]: https://doc.qt.io/qt-6/qimage.html#scanLine
This commit is contained in:
Sertonix Norson
2026-10-03 10:34:55 +00:00
committed by Albert Astals Cid
parent e23328fda8
commit f5ba223e15
+3
View File
@@ -311,6 +311,9 @@ bool TIMHandler::read(QImage *image)
qCWarning(LOG_TIMPLUGIN) << "TIMHandler::read() error while reading image scanline";
return false;
}
if (img.format() == QImage::Format_RGB555) {
qFromLittleEndian<quint16>(line, size / 2, line);
}
if (conv_4bpp) {
for (auto x = 0, w = qint32(tmpBuff.size()); x < w; ++x) {
auto &&v = tmpBuff.at(x);