mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-10-03 17:52:04 -04:00
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:
committed by
Albert Astals Cid
parent
e23328fda8
commit
f5ba223e15
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user