]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Test case for squeezing an oversized image into a page. Currently fails because min...
authorJeremias Maerki <jeremias@apache.org>
Wed, 31 Aug 2005 14:32:59 +0000 (14:32 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 31 Aug 2005 14:32:59 +0000 (14:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@265051 13f79535-47bb-0310-9956-ffa450edef68

test/layoutengine/disabled-testcases.txt
test/layoutengine/testcases/external-graphic4.xml [new file with mode: 0644]
test/resources/images/big-image.png [new file with mode: 0644]

index e669e594d6352e7d10da934c2ffe37499c861272..752b94bedd3560ce05700e093d9fe7c56a7f65fe 100644 (file)
@@ -11,6 +11,7 @@ background-image7.xml
 block-container4a.xml
 external-graphic1.xml
 external-graphic2.xml
+external-graphic4.xml
 inline-block2.xml
 inline-container1.xml
 keep-together-inline1.xml
diff --git a/test/layoutengine/testcases/external-graphic4.xml b/test/layoutengine/testcases/external-graphic4.xml
new file mode 100644 (file)
index 0000000..3b091a8
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+  Copyright 2005 The Apache Software Foundation\r
+\r
+  Licensed under the Apache License, Version 2.0 (the "License");\r
+  you may not use this file except in compliance with the License.\r
+  You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+  Unless required by applicable law or agreed to in writing, software\r
+  distributed under the License is distributed on an "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  See the License for the specific language governing permissions and\r
+  limitations under the License.\r
+-->\r
+<!-- $Id$ -->\r
+<testcase>\r
+  <info>\r
+    <p>\r
+      This test checks external-graphics. An oversized image is to be squeezed into page using min/opt/max values.\r
+    </p>\r
+  </info>\r
+  <fo>\r
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">\r
+      <fo:layout-master-set>\r
+        <fo:simple-page-master master-name="normal" page-width="21cm" page-height="29.7cm" margin="2cm">\r
+          <fo:region-body background-color="yellow"/>\r
+        </fo:simple-page-master>\r
+      </fo:layout-master-set>\r
+      <fo:page-sequence master-reference="normal" white-space-collapse="true">\r
+        <fo:flow flow-name="xsl-region-body">\r
+          <fo:block font-size="8pt">This first block is only to force an infinite loop if the image is not scaled down.</fo:block>\r
+          <!-- TODO If you remove the above block, the image is placed on the page although it's too big. No warnings. -->\r
+          <fo:block>\r
+            <fo:external-graphic src="../../resources/images/big-image.png" \r
+                inline-progression-dimension.maximum="100%" block-progression-dimension.maximum="100%"\r
+                content-width="scale-to-fit" content-height="scale-to-fit" overflow="hidden"/>\r
+          </fo:block>\r
+          <fo:block>EOF</fo:block>\r
+        </fo:flow>\r
+      </fo:page-sequence>\r
+    </fo:root>\r
+  </fo>\r
+  <checks>\r
+    <eval expected="0 0 595275 841889" xpath="//pageViewport/@bounds"/>\r
+    <eval expected="481891" xpath="//regionBody/@ipda"/>\r
+    <eval expected="728505" xpath="//regionBody/@bpda"/>\r
+    <eval expected="481891" xpath="//flow/block[2]/lineArea/viewport/@ipda"/>\r
+    <eval expected="728505" xpath="//flow/block[2]/lineArea/viewport/@bpda + //flow/block[1]/@bpda"/>\r
+  </checks>\r
+</testcase>\r
diff --git a/test/resources/images/big-image.png b/test/resources/images/big-image.png
new file mode 100644 (file)
index 0000000..e08b02c
Binary files /dev/null and b/test/resources/images/big-image.png differ