Fix DIB image reading.
Position the QIODevice correctly for DIB (==BMP without file header). Task-number: QTBUG-26690 Change-Id: I7922b4e830a92dcc19f1b52e305ca9ff3fd5d9f5 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>bb10
parent
7c382d81d9
commit
a0af0fbcd4
|
|
@ -757,7 +757,10 @@ bool QBmpHandler::read(QImage *image)
|
|||
s.setByteOrder(QDataStream::LittleEndian);
|
||||
|
||||
// read image
|
||||
if (!read_dib_body(s, infoHeader, fileHeader.bfOffBits, startpos, *image))
|
||||
const bool readSuccess = m_format == BmpFormat ?
|
||||
read_dib_body(s, infoHeader, fileHeader.bfOffBits, startpos, *image) :
|
||||
read_dib_body(s, infoHeader, -1, startpos - BMP_FILEHDR_SIZE, *image);
|
||||
if (!readSuccess)
|
||||
return false;
|
||||
|
||||
state = Ready;
|
||||
|
|
|
|||
Loading…
Reference in New Issue