Commit 85ed63f8 authored by J-P Nurmi's avatar J-P Nurmi
Browse files

Fix QWebpHandler::canRead() to take animation frame count into account


Task-number: QTBUG-61641
Change-Id: I24a139cc75141a588f2ed2558da85cd2f8391af9
Reviewed-by: default avatarEirik Aavitsland <eirik.aavitsland@qt.io>
Showing with 5 additions and 0 deletions
...@@ -74,6 +74,10 @@ bool QWebpHandler::canRead() const ...@@ -74,6 +74,10 @@ bool QWebpHandler::canRead() const
if (m_scanState != ScanError) { if (m_scanState != ScanError) {
setFormat(QByteArrayLiteral("webp")); setFormat(QByteArrayLiteral("webp"));
if (m_features.has_animation && m_iter.frame_num >= m_frameCount)
return false;
return true; return true;
} }
return false; return false;
......
...@@ -127,6 +127,7 @@ void tst_qwebp::readAnimation() ...@@ -127,6 +127,7 @@ void tst_qwebp::readAnimation()
} }
QVERIFY(reader.read().isNull()); QVERIFY(reader.read().isNull());
QCOMPARE(reader.canRead(), !reader.supportsAnimation());
} }
void tst_qwebp::writeImage_data() void tst_qwebp::writeImage_data()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment