Fix QWebpHandler::canRead() to take animation frame count into account
Task-number: QTBUG-61641 Change-Id: I24a139cc75141a588f2ed2558da85cd2f8391af9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
parent
2454fdd917
commit
85ed63f825
|
@ -74,6 +74,10 @@ bool QWebpHandler::canRead() const
|
|||
|
||||
if (m_scanState != ScanError) {
|
||||
setFormat(QByteArrayLiteral("webp"));
|
||||
|
||||
if (m_features.has_animation && m_iter.frame_num >= m_frameCount)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -127,6 +127,7 @@ void tst_qwebp::readAnimation()
|
|||
}
|
||||
|
||||
QVERIFY(reader.read().isNull());
|
||||
QCOMPARE(reader.canRead(), !reader.supportsAnimation());
|
||||
}
|
||||
|
||||
void tst_qwebp::writeImage_data()
|
||||
|
|
Loading…
Reference in New Issue