From f5ba223e1525d407823117e5c9ebacb45cadb711 Mon Sep 17 00:00:00 2001 From: Sertonix Norson Date: Thu, 1 Oct 2026 13:51:35 +0200 Subject: [PATCH] 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 --- src/imageformats/tim.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/imageformats/tim.cpp b/src/imageformats/tim.cpp index 312886b..353438f 100644 --- a/src/imageformats/tim.cpp +++ b/src/imageformats/tim.cpp @@ -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(line, size / 2, line); + } if (conv_4bpp) { for (auto x = 0, w = qint32(tmpBuff.size()); x < w; ++x) { auto &&v = tmpBuff.at(x);