Add test case for apng failed to detect from content

This commit is contained in:
Skye Deving 2021-01-07 04:03:51 -06:00
parent 517ebdf247
commit c7f8670794

View File

@ -37,10 +37,17 @@ TEST_CASE("Detect png animation", "[apng][noci]") {
p.setFormat("png"); p.setFormat("png");
REQUIRE(!QPixmap::fromImage(p.read()).isNull()); REQUIRE(!QPixmap::fromImage(p.read()).isNull());
// Auto detect fails // Auto detect fails on apng
QImageReader d; QImageReader d;
d.setAutoDetectImageFormat(true); d.setDecideFormatFromContent(true);
d.setFileName("snackoo.png"); d.setFileName("snackoo.png");
REQUIRE(!d.supportsAnimation()); REQUIRE(!d.supportsAnimation());
REQUIRE(!QPixmap::fromImage(d.read()).isNull()); REQUIRE(!QPixmap::fromImage(d.read()).isNull());
// Decide format fom content fails on apng
QImageReader c;
c.setDecideFormatFromContent(true);
c.setFileName("snackoo.png");
REQUIRE(!c.supportsAnimation());
REQUIRE(!QPixmap::fromImage(c.read()).isNull());
} }