Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package xmlgraphics-commons for 
openSUSE:Factory checked in at 2021-02-01 13:24:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xmlgraphics-commons (Old)
 and      /work/SRC/openSUSE:Factory/.xmlgraphics-commons.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xmlgraphics-commons"

Mon Feb  1 13:24:39 2021 rev:27 rq:866482 version:2.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/xmlgraphics-commons/xmlgraphics-commons.changes  
2020-06-08 23:43:53.441338312 +0200
+++ 
/work/SRC/openSUSE:Factory/.xmlgraphics-commons.new.28504/xmlgraphics-commons.changes
       2021-02-01 13:24:41.389774105 +0100
@@ -1,0 +2,10 @@
+Sun Jan 24 18:23:07 UTC 2021 - Fridrich Strba <[email protected]>
+
+- Update to version 2.6:
+  * minor release
+  * changes:
+    + Fix test on Windows
+    + XGC-122: Dont load DTDs in XMP
+    + XGC-123: Decode image at page load rather than document load
+
+-------------------------------------------------------------------

Old:
----
  xmlgraphics-commons-2.4-src.tar.gz

New:
----
  xmlgraphics-commons-2.6-src.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xmlgraphics-commons.spec ++++++
--- /var/tmp/diff_new_pack.lsHUSR/_old  2021-02-01 13:24:42.121775253 +0100
+++ /var/tmp/diff_new_pack.lsHUSR/_new  2021-02-01 13:24:42.125775260 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package xmlgraphics-commons
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 # Copyright (c) 2000-2008, JPackage Project
 #
 # All modifications and additions to the file contributed by third parties
@@ -18,7 +18,7 @@
 
 
 Name:           xmlgraphics-commons
-Version:        2.4
+Version:        2.6
 Release:        0
 Summary:        XML Graphics Commons
 License:        Apache-2.0

++++++ xmlgraphics-commons-2.4-src.tar.gz -> xmlgraphics-commons-2.6-src.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xmlgraphics-commons-2.4/NOTICE 
new/xmlgraphics-commons-2.6/NOTICE
--- old/xmlgraphics-commons-2.4/NOTICE  2019-10-25 10:01:30.000000000 +0200
+++ new/xmlgraphics-commons-2.6/NOTICE  2021-01-12 11:44:35.000000000 +0100
@@ -1,5 +1,5 @@
 Apache XML Graphics Commons
-Copyright 2006-2019 The Apache Software Foundation
+Copyright 2006-2021 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xmlgraphics-commons-2.4/README 
new/xmlgraphics-commons-2.6/README
--- old/xmlgraphics-commons-2.4/README  2019-10-25 10:01:30.000000000 +0200
+++ new/xmlgraphics-commons-2.6/README  2021-01-12 11:44:35.000000000 +0100
@@ -1,4 +1,4 @@
-$Id: README 1868849 2019-10-24 07:50:09Z ssteiner $
+$Id: README 1885379 2021-01-12 09:32:59Z ssteiner $
 
 ==============================================================================
   APACHE XML GRAPHICS COMMONS  -  README
@@ -82,6 +82,11 @@
 For more detailed info about the changes, please see:
 http://xmlgraphics.apache.org/commons/changes.html
 
+Version 2.6
+--------------
+
+Minor release to be used with FOP 2.6
+
 Version 2.4
 --------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xmlgraphics-commons-2.4/build.properties 
new/xmlgraphics-commons-2.6/build.properties
--- old/xmlgraphics-commons-2.4/build.properties        2019-10-25 
10:01:30.000000000 +0200
+++ new/xmlgraphics-commons-2.6/build.properties        2021-01-12 
11:44:35.000000000 +0100
@@ -34,7 +34,7 @@
 ## ===================================================================
 ## 3. Project specific properties
 
-version = 2.4
+version = 2.6
 
 ## Allows you to switch off the compilation of the internal image
 ## codecs which depend on Sun-private classes. Setting this to true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xmlgraphics-commons-2.4/build.xml 
new/xmlgraphics-commons-2.6/build.xml
--- old/xmlgraphics-commons-2.4/build.xml       2019-10-25 10:01:30.000000000 
+0200
+++ new/xmlgraphics-commons-2.6/build.xml       2021-01-12 11:44:35.000000000 
+0100
@@ -25,7 +25,7 @@
 
   <property name="Name" value="Apache XML Graphics Commons"/>
   <property name="name" value="xmlgraphics-commons"/>
-  <property name="year" value="1999-2019"/>
+  <property name="year" value="1999-2021"/>
 
   <property name="javac.debug" value="on"/>
   <property name="javac.optimize" value="off"/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xmlgraphics-commons-2.4/pom.xml 
new/xmlgraphics-commons-2.6/pom.xml
--- old/xmlgraphics-commons-2.4/pom.xml 2019-10-25 10:01:30.000000000 +0200
+++ new/xmlgraphics-commons-2.6/pom.xml 2021-01-12 11:44:35.000000000 +0100
@@ -4,7 +4,7 @@
 
   <groupId>org.apache.xmlgraphics</groupId>
   <artifactId>xmlgraphics-commons</artifactId>
-  <version>2.4</version>
+  <version>2.6</version>
   <name>${project.groupId}:${project.artifactId}</name>
   <description>XML Graphics Commons</description>
   <url>http://xmlgraphics.apache.org/commons/</url>
@@ -88,8 +88,6 @@
           <configuration>
             <source>${java.version}</source>
             <target>${java.version}</target>
-            <executable>${jdk.path}/bin/javac</executable>
-            <fork>true</fork>
           </configuration>
         </plugin>
         <plugin>
@@ -174,6 +172,33 @@
       </testResource>
     </testResources>
   </build>
+  
+  <profiles>
+    <profile>
+      <id>custom-javac</id>
+      <activation>
+        <property>
+          <name>jdk.path</name>
+        </property>
+      </activation>
+      <build>
+        <pluginManagement>
+          <plugins>
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-compiler-plugin</artifactId>
+              <configuration>
+                <source>${java.version}</source>
+                <target>${java.version}</target>
+                <executable>${jdk.path}/bin/javac</executable>
+                <fork>true</fork>
+              </configuration>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+      </build>
+    </profile>
+  </profiles>  
 
   <reporting>
     <plugins>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/ps/ImageFormGenerator.java
 
new/xmlgraphics-commons-2.6/src/main/java/org/apache/xmlgraphics/ps/ImageFormGenerator.java
--- 
old/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/ps/ImageFormGenerator.java
 2019-10-25 10:01:30.000000000 +0200
+++ 
new/xmlgraphics-commons-2.6/src/main/java/org/apache/xmlgraphics/ps/ImageFormGenerator.java
 2021-01-12 11:44:35.000000000 +0100
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: ImageFormGenerator.java 750418 2009-03-05 11:03:54Z vhennebert $ */
+/* $Id: ImageFormGenerator.java 1881060 2020-08-21 15:38:04Z ssteiner $ */
 
 package org.apache.xmlgraphics.ps;
 
@@ -114,7 +114,7 @@
             return "/ASCII85Decode filter " + implicitFilter + " filter";
         } else {
             if (gen.getPSLevel() >= 3) {
-                return "/ASCII85Decode filter /FlateDecode filter";
+                return "/ASCII85Decode filter";
             } else {
                 return "/ASCII85Decode filter /RunLengthDecode filter";
             }
@@ -133,6 +133,12 @@
             dataSource = "{ " + getDataName() + " i get /i i 1 add store } 
bind";
         } else {
             dataSource = getDataName();
+            if (gen.getPSLevel() >= 3) {
+                String implicitFilter = encoder.getImplicitFilter();
+                if (implicitFilter == null) {
+                    dataSource += " /FlateDecode filter";
+                }
+            }
         }
         AffineTransform at = new AffineTransform();
         at.scale(getDimensions().getWidth(), getDimensions().getHeight());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/xmp/XMPParser.java
 
new/xmlgraphics-commons-2.6/src/main/java/org/apache/xmlgraphics/xmp/XMPParser.java
--- 
old/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/xmp/XMPParser.java
 2019-10-25 10:01:30.000000000 +0200
+++ 
new/xmlgraphics-commons-2.6/src/main/java/org/apache/xmlgraphics/xmp/XMPParser.java
 2021-01-12 11:44:35.000000000 +0100
@@ -15,12 +15,13 @@
  * limitations under the License.
  */
 
-/* $Id: XMPParser.java 1345683 2012-06-03 14:50:33Z gadams $ */
+/* $Id: XMPParser.java 1878394 2020-06-02 13:18:41Z ssteiner $ */
 
 package org.apache.xmlgraphics.xmp;
 
 import java.net.URL;
 
+import javax.xml.XMLConstants;
 import javax.xml.transform.Source;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerException;
@@ -54,6 +55,8 @@
      */
     public static Metadata parseXMP(Source src) throws TransformerException {
         TransformerFactory tFactory = TransformerFactory.newInstance();
+        tFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
+        tFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
         Transformer transformer = tFactory.newTransformer();
         XMPHandler handler = createXMPHandler();
         SAXResult res = new SAXResult(handler);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/ps/FormGeneratorTestCase.java
 
new/xmlgraphics-commons-2.6/src/test/java/org/apache/xmlgraphics/ps/FormGeneratorTestCase.java
--- 
old/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/ps/FormGeneratorTestCase.java
      1970-01-01 01:00:00.000000000 +0100
+++ 
new/xmlgraphics-commons-2.6/src/test/java/org/apache/xmlgraphics/ps/FormGeneratorTestCase.java
      2021-01-12 11:44:35.000000000 +0100
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.xmlgraphics.ps;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.color.ColorSpace;
+
+
+import java.awt.geom.Dimension2D;
+import java.awt.image.BufferedImage;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import org.apache.xmlgraphics.java2d.Dimension2DDouble;
+import org.apache.xmlgraphics.java2d.color.NamedColorSpace;
+
+
+public class FormGeneratorTestCase {
+    @Test
+    public void testGeneratePaintProc() throws IOException {
+        Dimension2D dimension = new Dimension2DDouble(300, 500);
+        BufferedImage im = new BufferedImage(100, 75, 
BufferedImage.TYPE_INT_ARGB);
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        ImageFormGenerator formImageGen = new  ImageFormGenerator("form", 
"title", dimension, im, false);
+        PSGenerator gen = new PSGenerator(out);
+        formImageGen.generatePaintProc(gen);
+        String test = out.toString("UTF-8");
+
+        String  expected = "    form:Data 0 setfileposition\n"
+        + "[300 0 0 500 0 0] CT\n"
+        + "/DeviceRGB setcolorspace\n"
+        + "<<\n";
+        Assert.assertTrue(test.contains(expected));
+        Assert.assertTrue(test.contains("  /DataSource form:Data"));
+        Assert.assertTrue(test.contains("  /ImageMatrix [100 0 0 75 0 0]\n"));
+        Assert.assertTrue(test.contains("  /BitsPerComponent 8\n"));
+        Assert.assertTrue(test.contains("  /Height 75\n"));
+        Assert.assertTrue(test.contains("  /ImageType 1\n"));
+        Assert.assertTrue(test.contains("  /Decode [0 1 0 1 0 1]\n"));
+        Assert.assertTrue(test.contains(">> image\n"));
+        out.reset();
+        im = null;
+
+        Color c = Color.BLUE;
+        Dimension dimensionPX = new Dimension(200, 400);
+        ImageEncoder enco = ImageEncodingHelper.createRenderedImageEncoder(im);
+        ColorSpace cs = new NamedColorSpace("myColor", c);
+        formImageGen = new  ImageFormGenerator("form", "title", dimension, 
dimensionPX, enco, cs, false);
+        gen = new PSGenerator(out);
+        gen.setPSLevel(2);
+        formImageGen.generatePaintProc(gen);
+        test = out.toString("UTF-8");
+        expected = "    userdict /i 0 put\n"
+            + "[300 0 0 500 0 0] CT\n"
+            + "/DeviceGray setcolorspace\n"
+            + "<<\n";
+        Assert.assertTrue(test.contains(expected));
+        Assert.assertTrue(test.contains("  /DataSource { form:Data i get /i i 
1 add store } bind\n"));
+        Assert.assertTrue(test.contains("  /ImageMatrix [200 0 0 400 0 0]\n"));
+        Assert.assertTrue(test.contains("  /Height 400\n"));
+        Assert.assertTrue(test.contains("  /BitsPerComponent 8\n"));
+        Assert.assertTrue(test.contains("  /ImageType 1\n"));
+        Assert.assertTrue(test.contains("  /Decode [0 1]\n"));
+        Assert.assertTrue(test.contains("  /Width 200\n"));
+        Assert.assertTrue(test.contains(">> image\n"));
+    }
+
+    @Test
+    public void testFlateDecodeCommand() throws IOException {
+        Dimension2D dimension = new Dimension2DDouble(300, 500);
+        BufferedImage im = new BufferedImage(100, 75, 
BufferedImage.TYPE_INT_ARGB);
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        ImageFormGenerator formImageGen = new ImageFormGenerator("form", 
"title", dimension, im, false);
+        PSGenerator gen = new PSGenerator(out);
+        formImageGen.generate(gen);
+        String test = out.toString("UTF-8");
+        Assert.assertTrue(test.contains("/ASCII85Decode filter\n"));
+        //FlateDecode at DataSource so executed on page load rather than 
document load so viewer loads faster
+        Assert.assertTrue(test.contains("/DataSource form:Data /FlateDecode 
filter\n"));
+    }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/util/io/Base64TestCase.java
 
new/xmlgraphics-commons-2.6/src/test/java/org/apache/xmlgraphics/util/io/Base64TestCase.java
--- 
old/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/util/io/Base64TestCase.java
        2019-10-25 10:01:30.000000000 +0200
+++ 
new/xmlgraphics-commons-2.6/src/test/java/org/apache/xmlgraphics/util/io/Base64TestCase.java
        2021-01-12 11:44:35.000000000 +0100
@@ -15,10 +15,12 @@
  * limitations under the License.
  */
 
-/* $Id: Base64TestCase.java 1732018 2016-02-24 04:51:06Z gadams $ */
+/* $Id: Base64TestCase.java 1876186 2020-04-06 13:37:10Z ssteiner $ */
 
 package org.apache.xmlgraphics.util.io;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -31,15 +33,17 @@
 
 import static org.junit.Assert.fail;
 
+import org.apache.commons.io.IOUtils;
+
 /**
  * This test validates that the Base64 encoder/decoders work properly.
  *
- * @version $Id: Base64TestCase.java 1732018 2016-02-24 04:51:06Z gadams $
+ * @version $Id: Base64TestCase.java 1876186 2020-04-06 13:37:10Z ssteiner $
  */
 public class Base64TestCase {
 
     private void innerBase64Test(String action, URL in, URL ref) throws 
Exception {
-        InputStream inIS = in.openStream();
+        InputStream inIS = dos2Unix(in);
 
         if (action.equals("ROUND")) {
             ref = in;
@@ -47,7 +51,7 @@
             fail("Bad action string");
         }
 
-        InputStream refIS = ref.openStream();
+        InputStream refIS = dos2Unix(ref);
 
         if (action.equals("ENCODE") || action.equals("ROUND")) {
             // We need to encode the incomming data
@@ -74,6 +78,21 @@
         }
     }
 
+    private InputStream dos2Unix(URL url) throws IOException {
+        InputStream is = url.openStream();
+        byte[] data = IOUtils.toByteArray(is);
+        if (data.length > 1 && data[data.length - 1] == '\n') {
+            ByteArrayOutputStream bos = new ByteArrayOutputStream();
+            for (byte b : data) {
+                if (b != '\r') {
+                    bos.write(b);
+                }
+            }
+            return new ByteArrayInputStream(bos.toByteArray());
+        }
+        return new ByteArrayInputStream(data);
+    }
+
     private void innerBase64Test(String action, String in, String ref) throws 
Exception {
         final String baseURL = 
"file:src/test/resources/org/apache/xmlgraphics/util/io/";
         innerBase64Test(action, new URL(baseURL + in), new URL(baseURL + ref));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/xmp/XMPParserTestCase.java
 
new/xmlgraphics-commons-2.6/src/test/java/org/apache/xmlgraphics/xmp/XMPParserTestCase.java
--- 
old/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/xmp/XMPParserTestCase.java
 2019-10-25 10:01:30.000000000 +0200
+++ 
new/xmlgraphics-commons-2.6/src/test/java/org/apache/xmlgraphics/xmp/XMPParserTestCase.java
 2021-01-12 11:44:35.000000000 +0100
@@ -15,20 +15,25 @@
  * limitations under the License.
  */
 
-/* $Id: XMPParserTestCase.java 1732018 2016-02-24 04:51:06Z gadams $ */
+/* $Id: XMPParserTestCase.java 1878394 2020-06-02 13:18:41Z ssteiner $ */
 
 package org.apache.xmlgraphics.xmp;
 
+import java.io.StringReader;
 import java.net.URL;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.TimeZone;
 
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.stream.StreamSource;
+
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.xmlgraphics.xmp.schemas.DublinCoreAdapter;
 import org.apache.xmlgraphics.xmp.schemas.DublinCoreSchema;
@@ -189,4 +194,18 @@
         assertNull(title); //Empty value treated same as not existant
     }
 
+    @Test
+    public void testExternalDTD() {
+        String payload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+                + "<!DOCTYPE root [\n<!ENTITY % remote SYSTEM 
\"http://127.0.0.1:9999/eval.xml\";>\n%remote;]>\n"
+                + "<root></root>";
+        StreamSource streamSource = new StreamSource(new 
StringReader(payload));
+        String msg = "";
+        try {
+            XMPParser.parseXMP(streamSource);
+        } catch (TransformerException e) {
+            msg = e.getMessage();
+        }
+        assertTrue(msg, msg.contains("access is not allowed"));
+    }
 }

Reply via email to