raw: fix multi image load

Fixes not loading a second image in the file. This patch allow code like the following.

QImageReader r(file);
do {
    auto qi = r.read();
    if (!qi.isNull()) {
        qi.save(QString("/tmp/%1_%2.tif")
                .arg(QFileInfo(file).baseName())
                .arg(r.currentImageNumber()));
    }
}
while (r.jumpToNextImage());

m_startPos is used to reposition the device if you decide to do a subsequent read: libraw wants it to be at the beginning of the RAW stream
This commit is contained in:
Mirco Miranda
2023-09-25 20:55:53 +00:00
committed by Albert Astals Cid
parent 7899c27a80
commit 18ea0492bc
2 changed files with 20 additions and 2 deletions

View File

@ -74,6 +74,12 @@ private:
* When the quality is -1, default quality is used.
*/
qint32 m_quality;
/*!
* \brief m_startPos
* The initial device position to allow multi image load (cache value).
*/
qint64 m_startPos;
};
class RAWPlugin : public QImageIOPlugin