diff options
Diffstat (limited to 'vcl/qa/cppunit')
-rw-r--r-- | vcl/qa/cppunit/png/PngFilterTest.cxx | 17 | ||||
-rw-r--r-- | vcl/qa/cppunit/png/data/ms-gif.png | bin | 0 -> 15901 bytes |
2 files changed, 17 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/png/PngFilterTest.cxx b/vcl/qa/cppunit/png/PngFilterTest.cxx index 28e6c719f6fd..3b02e1135504 100644 --- a/vcl/qa/cppunit/png/PngFilterTest.cxx +++ b/vcl/qa/cppunit/png/PngFilterTest.cxx @@ -26,6 +26,7 @@ #include <vcl/filter/PngImageReader.hxx> #include <vcl/BitmapReadAccess.hxx> #include <vcl/alpha.hxx> +#include <vcl/graphicfilter.hxx> using namespace css; @@ -46,9 +47,11 @@ public: } void testPng(); + void testMsGifInPng(); CPPUNIT_TEST_SUITE(PngFilterTest); CPPUNIT_TEST(testPng); + CPPUNIT_TEST(testMsGifInPng); CPPUNIT_TEST_SUITE_END(); }; @@ -222,6 +225,20 @@ void PngFilterTest::testPng() } } +void PngFilterTest::testMsGifInPng() +{ + Graphic aGraphic; + const OUString aURL(getFullUrl(u"ms-gif.png")); + SvFileStream aFileStream(aURL, StreamMode::READ); + GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); + ErrCode aResult = rFilter.ImportGraphic(aGraphic, aURL, aFileStream); + CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, aResult); + CPPUNIT_ASSERT(aGraphic.IsGfxLink()); + // The image is technically a PNG, but it has an animated Gif as a chunk (Microsoft extension). + CPPUNIT_ASSERT_EQUAL(GfxLinkType::NativeGif, aGraphic.GetSharedGfxLink()->GetType()); + CPPUNIT_ASSERT(aGraphic.IsAnimated()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(PngFilterTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/vcl/qa/cppunit/png/data/ms-gif.png b/vcl/qa/cppunit/png/data/ms-gif.png Binary files differnew file mode 100644 index 000000000000..1f683241f53f --- /dev/null +++ b/vcl/qa/cppunit/png/data/ms-gif.png |