summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/GraphicTest.cxx12
-rw-r--r--vcl/qa/cppunit/data/tdf149545.svg32
-rw-r--r--vcl/source/filter/GraphicFormatDetector.cxx2
3 files changed, 45 insertions, 1 deletions
diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx
index 606936c65f9e..ef9678e42197 100644
--- a/vcl/qa/cppunit/GraphicTest.cxx
+++ b/vcl/qa/cppunit/GraphicTest.cxx
@@ -1294,6 +1294,18 @@ CPPUNIT_TEST_FIXTURE(GraphicTest, testTdf156016)
CPPUNIT_ASSERT_EQUAL(tools::Long(100 * scalingY), aGraphic.GetSizePixel().Height());
}
+CPPUNIT_TEST_FIXTURE(GraphicTest, testTdf149545)
+{
+ // Without the fix in place, this test would have failed with
+ // - Expected: 0x0(Error Area:Io Class:NONE Code:0)
+ // - Actual : 0x8203(Error Area:Vcl Class:General Code:3)
+ Graphic aGraphic = loadGraphic(u"tdf149545.svg");
+ CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType());
+ const auto[scalingX, scalingY] = getDPIScaling();
+ CPPUNIT_ASSERT_EQUAL(tools::Long(100 * scalingX), aGraphic.GetSizePixel().Width());
+ CPPUNIT_ASSERT_EQUAL(tools::Long(100 * scalingY), aGraphic.GetSizePixel().Height());
+}
+
CPPUNIT_TEST_FIXTURE(GraphicTest, testAvailableThreaded)
{
Graphic jpgGraphic1 = importUnloadedGraphic(u"TypeDetectionExample.jpg");
diff --git a/vcl/qa/cppunit/data/tdf149545.svg b/vcl/qa/cppunit/data/tdf149545.svg
new file mode 100644
index 000000000000..39fd956142bd
--- /dev/null
+++ b/vcl/qa/cppunit/data/tdf149545.svg
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 99 99">
+<rect x="0" y="0" width="99" height="99" fill="#000000"/>
+</svg>
+
+
diff --git a/vcl/source/filter/GraphicFormatDetector.cxx b/vcl/source/filter/GraphicFormatDetector.cxx
index 2cf9e953003e..38a6ec28585e 100644
--- a/vcl/source/filter/GraphicFormatDetector.cxx
+++ b/vcl/source/filter/GraphicFormatDetector.cxx
@@ -32,7 +32,7 @@
#include <vcl/outdev.hxx>
#include <utility>
-constexpr sal_uInt32 SVG_CHECK_SIZE = 2048;
+constexpr sal_uInt32 SVG_CHECK_SIZE = 8192;
constexpr sal_uInt32 WMF_EMF_CHECK_SIZE = 44;
namespace