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:
J-P Nurmi 2017-06-26 16:00:39 +02:00
parent 2454fdd917
commit 85ed63f825
2 changed files with 5 additions and 0 deletions

View File

@ -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;

View File

@ -127,6 +127,7 @@ void tst_qwebp::readAnimation()
}
QVERIFY(reader.read().isNull());
QCOMPARE(reader.canRead(), !reader.supportsAnimation());
}
void tst_qwebp::writeImage_data()