Hello community,
here is the log from the commit of package xmlgraphics-commons for
openSUSE:Factory checked in at 2020-06-08 23:43:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xmlgraphics-commons (Old)
and /work/SRC/openSUSE:Factory/.xmlgraphics-commons.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xmlgraphics-commons"
Mon Jun 8 23:43:48 2020 rev:26 rq:811264 version:2.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/xmlgraphics-commons/xmlgraphics-commons.changes
2020-04-05 20:52:58.737150113 +0200
+++
/work/SRC/openSUSE:Factory/.xmlgraphics-commons.new.3606/xmlgraphics-commons.changes
2020-06-08 23:43:53.441338312 +0200
@@ -1,0 +2,7 @@
+Thu Jun 4 05:05:24 UTC 2020 - Fridrich Strba <[email protected]>
+
+- Update to version 2.4:
+ * minor release
+ * no changelog available
+
+-------------------------------------------------------------------
Old:
----
xmlgraphics-commons-2.3-src.tar.gz
New:
----
xmlgraphics-commons-2.4-src.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xmlgraphics-commons.spec ++++++
--- /var/tmp/diff_new_pack.nas3tw/_old 2020-06-08 23:43:54.149340496 +0200
+++ /var/tmp/diff_new_pack.nas3tw/_new 2020-06-08 23:43:54.153340508 +0200
@@ -18,7 +18,7 @@
Name: xmlgraphics-commons
-Version: 2.3
+Version: 2.4
Release: 0
Summary: XML Graphics Commons
License: Apache-2.0
++++++ xmlgraphics-commons-2.3-src.tar.gz -> xmlgraphics-commons-2.4-src.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xmlgraphics-commons-2.3/NOTICE
new/xmlgraphics-commons-2.4/NOTICE
--- old/xmlgraphics-commons-2.3/NOTICE 2018-05-14 11:00:43.000000000 +0200
+++ new/xmlgraphics-commons-2.4/NOTICE 2019-10-25 10:01:30.000000000 +0200
@@ -1,5 +1,5 @@
Apache XML Graphics Commons
-Copyright 2006-2018 The Apache Software Foundation
+Copyright 2006-2019 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.3/README
new/xmlgraphics-commons-2.4/README
--- old/xmlgraphics-commons-2.3/README 2018-05-14 11:00:43.000000000 +0200
+++ new/xmlgraphics-commons-2.4/README 2019-10-25 10:01:30.000000000 +0200
@@ -1,4 +1,4 @@
-$Id: README 1831544 2018-05-14 08:05:15Z ssteiner $
+$Id: README 1868849 2019-10-24 07:50:09Z 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.4
+--------------
+
+Minor release to be used with FOP 2.4
+
Version 2.3
--------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xmlgraphics-commons-2.3/build.properties
new/xmlgraphics-commons-2.4/build.properties
--- old/xmlgraphics-commons-2.3/build.properties 2018-05-14
11:00:43.000000000 +0200
+++ new/xmlgraphics-commons-2.4/build.properties 2019-10-25
10:01:30.000000000 +0200
@@ -34,7 +34,7 @@
## ===================================================================
## 3. Project specific properties
-version = 2.3
+version = 2.4
## 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.3/build.xml
new/xmlgraphics-commons-2.4/build.xml
--- old/xmlgraphics-commons-2.3/build.xml 2018-05-14 11:00:43.000000000
+0200
+++ new/xmlgraphics-commons-2.4/build.xml 2019-10-25 10:01:30.000000000
+0200
@@ -25,13 +25,13 @@
<property name="Name" value="Apache XML Graphics Commons"/>
<property name="name" value="xmlgraphics-commons"/>
- <property name="year" value="1999-2018"/>
+ <property name="year" value="1999-2019"/>
<property name="javac.debug" value="on"/>
<property name="javac.optimize" value="off"/>
<property name="javac.deprecation" value="on"/>
- <property name="javac.source" value="1.6"/>
- <property name="javac.target" value="1.6"/>
+ <property name="javac.source" value="1.7"/>
+ <property name="javac.target" value="1.7"/>
<property name="javac.fork" value="no"/>
<property name="junit.fork" value="on"/>
@@ -554,7 +554,9 @@
<target name="release-dist" depends="dist" description="Generates the
distribution package and signs the release">
<!--property name="bin.suffix"
value="bin-jdk${java.specification.version}"/-->
<property name="bin.suffix" value="bin"/>
- <input message="Passphrase for your default private key (attention:
passphrase will be echoed in clear text on the display!)" addproperty="pwd"/>
+ <input message="Passphrase for your default private key" addproperty="pwd">
+ <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
+ </input>
<antcall target="sha512">
<param name="sign.archive" value="${name}-${version}-src.zip"/>
</antcall>
@@ -622,7 +624,9 @@
<checksum algorithm="sha-512" fileext=".sha512">
<fileset refid="bundle-files"/>
</checksum>
- <input message="Passphrase for your default private key (attention:
passphrase will be echoed in clear text on the display!)" addproperty="pwd"/>
+ <input message="Passphrase for your default private key" addproperty="pwd">
+ <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
+ </input>
<antcall target="sign-file">
<param name="sign.archive" value="${build.dir}/${name}-${version}.jar"/>
<param name="pwd" value="${pwd}"/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xmlgraphics-commons-2.3/pom.xml
new/xmlgraphics-commons-2.4/pom.xml
--- old/xmlgraphics-commons-2.3/pom.xml 2018-05-14 11:00:43.000000000 +0200
+++ new/xmlgraphics-commons-2.4/pom.xml 2019-10-25 10:01:30.000000000 +0200
@@ -4,15 +4,16 @@
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>xmlgraphics-commons</artifactId>
- <version>2.3</version>
+ <version>2.4</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>XML Graphics Commons</description>
+ <url>http://xmlgraphics.apache.org/commons/</url>
<properties>
<checkstyle.version>2.15</checkstyle.version>
<exec.version>1.4.0</exec.version>
<findbugs.version>3.0.4</findbugs.version>
- <java.version>1.6</java.version>
+ <java.version>1.7</java.version>
<junit.version>4.11</junit.version>
<project.info.reports.version>2.8</project.info.reports.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xmlgraphics-commons-2.3/src/main/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderRawPNG.java
new/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderRawPNG.java
---
old/xmlgraphics-commons-2.3/src/main/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderRawPNG.java
2018-05-14 11:00:43.000000000 +0200
+++
new/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderRawPNG.java
2019-10-25 10:01:30.000000000 +0200
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: ImageLoaderRawPNG.java 1732019 2016-02-24 05:01:10Z gadams $ */
+/* $Id: ImageLoaderRawPNG.java 1843559 2018-10-11 14:59:17Z ssteiner $ */
// Original author: Matthias Reichenbacher
@@ -70,7 +70,7 @@
// Remove streams as we do things with them at some later time.
XmlSourceUtil.removeStreams(src);
SeekableStream seekStream = new
ImageInputStreamSeekableStreamAdapter(in);
- PNGFile im = new PNGFile(seekStream);
+ PNGFile im = new PNGFile(seekStream, info.getOriginalURI());
ImageRawPNG irpng = im.getImageRawPNG(info);
return irpng;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xmlgraphics-commons-2.3/src/main/java/org/apache/xmlgraphics/image/loader/impl/PNGFile.java
new/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/image/loader/impl/PNGFile.java
---
old/xmlgraphics-commons-2.3/src/main/java/org/apache/xmlgraphics/image/loader/impl/PNGFile.java
2018-05-14 11:00:43.000000000 +0200
+++
new/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/image/loader/impl/PNGFile.java
2019-10-25 10:01:30.000000000 +0200
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: PNGFile.java 1732019 2016-02-24 05:01:10Z gadams $ */
+/* $Id: PNGFile.java 1843559 2018-10-11 14:59:17Z ssteiner $ */
package org.apache.xmlgraphics.image.loader.impl;
@@ -69,7 +69,7 @@
private boolean hasPalette;
private boolean hasAlphaPalette;
- public PNGFile(InputStream stream) throws IOException, ImageException {
+ public PNGFile(InputStream stream, String uri) throws IOException,
ImageException {
if (!stream.markSupported()) {
stream = new BufferedInputStream(stream);
}
@@ -107,12 +107,14 @@
chunk = PNGChunk.readChunk(distream);
parse_sRGB_chunk(chunk);
} else {
- // chunk = PNGChunk.readChunk(distream);
+ if (Character.isUpperCase(chunkType.charAt(0))) {
+ throw new ImageException("PNG unknown critical chunk:
" + chunkType);
+ }
PNGChunk.skipChunk(distream);
}
} catch (Exception e) {
String msg = PropertyUtil.getString("PNGImageDecoder2");
- throw new RuntimeException(msg, e);
+ throw new RuntimeException(msg + " " + uri, e);
}
} while (true);
}
@@ -190,10 +192,6 @@
private void parse_IHDR_chunk(PNGChunk chunk) {
bitDepth = chunk.getInt1(8);
- if (bitDepth != 8) {
- // this is a limitation of the current implementation
- throw new RuntimeException("Unsupported bit depth: " + bitDepth);
- }
colorType = chunk.getInt1(9);
int compressionMethod = chunk.getInt1(10);
if (compressionMethod != 0) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xmlgraphics-commons-2.3/src/main/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriter.java
new/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriter.java
---
old/xmlgraphics-commons-2.3/src/main/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriter.java
2018-05-14 11:00:43.000000000 +0200
+++
new/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriter.java
2019-10-25 10:01:30.000000000 +0200
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: ImageIOTIFFImageWriter.java 1732018 2016-02-24 04:51:06Z gadams $ */
+/* $Id: ImageIOTIFFImageWriter.java 1833700 2018-06-18 10:08:45Z ssteiner $ */
package org.apache.xmlgraphics.image.writer.imageio;
@@ -40,14 +40,18 @@
/**
* ImageWriter that encodes TIFF images using Image I/O.
*
- * @version $Id: ImageIOTIFFImageWriter.java 1732018 2016-02-24 04:51:06Z
gadams $
+ * @version $Id: ImageIOTIFFImageWriter.java 1833700 2018-06-18 10:08:45Z
ssteiner $
*/
public class ImageIOTIFFImageWriter extends ImageIOImageWriter {
private static final String SUN_TIFF_NATIVE_FORMAT
= "com_sun_media_imageio_plugins_tiff_image_1.0";
+ private static final String JAVA_TIFF_NATIVE_FORMAT
+ = "javax_imageio_tiff_image_1.0";
private static final String SUN_TIFF_NATIVE_STREAM_FORMAT
= "com_sun_media_imageio_plugins_tiff_stream_1.0";
+ private static final String JAVA_TIFF_NATIVE_STREAM_FORMAT
+ = "javax_imageio_tiff_stream_1.0";
/**
* Main constructor.
@@ -65,14 +69,12 @@
//it doesn't work properly through the standard metadata. Haven't
figured out why
//that happens.
if (params.getResolution() != null) {
- if
(SUN_TIFF_NATIVE_FORMAT.equals(meta.getNativeMetadataFormatName())) {
- //IIOMetadataNode root =
(IIOMetadataNode)meta.getAsTree(SUN_TIFF_NATIVE_FORMAT);
- IIOMetadataNode root = new
IIOMetadataNode(SUN_TIFF_NATIVE_FORMAT);
+ if
(SUN_TIFF_NATIVE_FORMAT.equals(meta.getNativeMetadataFormatName())
+ ||
JAVA_TIFF_NATIVE_FORMAT.equals(meta.getNativeMetadataFormatName())) {
+ IIOMetadataNode root = new
IIOMetadataNode(meta.getNativeMetadataFormatName());
IIOMetadataNode ifd = getChildNode(root, "TIFFIFD");
if (ifd == null) {
ifd = new IIOMetadataNode("TIFFIFD");
- ifd.setAttribute("tagSets",
-
"com.sun.media.imageio.plugins.tiff.BaselineTIFFTagSet");
root.appendChild(ifd);
}
ifd.appendChild(createResolutionUnitField(params));
@@ -85,7 +87,7 @@
"RowsPerStrip", Integer.toString(rows)));
try {
- meta.mergeTree(SUN_TIFF_NATIVE_FORMAT, root);
+ meta.mergeTree(meta.getNativeMetadataFormatName(), root);
} catch (IIOInvalidTreeException e) {
throw new RuntimeException("Cannot update image metadata: "
+ e.getMessage(), e);
@@ -221,20 +223,27 @@
//Try changing the Byte Order
IIOMetadata streamMetadata =
writer.getDefaultStreamMetadata(writeParam);
- Set<String> names = new java.util.HashSet<String>(
- Arrays.asList(streamMetadata.getMetadataFormatNames()));
- if (names.contains(SUN_TIFF_NATIVE_STREAM_FORMAT)) {
- Node root =
streamMetadata.getAsTree(SUN_TIFF_NATIVE_STREAM_FORMAT);
+ if (streamMetadata != null) {
+ Set<String> names = new java.util.HashSet<String>(
+ Arrays.asList(streamMetadata.getMetadataFormatNames()));
+ setFromTree(names, streamMetadata, endian,
SUN_TIFF_NATIVE_STREAM_FORMAT);
+ setFromTree(names, streamMetadata, endian,
JAVA_TIFF_NATIVE_STREAM_FORMAT);
+ }
+ return streamMetadata;
+ }
+
+ private void setFromTree(Set<String> names, IIOMetadata streamMetadata,
Endianness endian, String format) {
+ if (names.contains(format)) {
+ Node root = streamMetadata.getAsTree(format);
root.getFirstChild().getAttributes().item(0).setNodeValue(endian.toString());
try {
- streamMetadata.setFromTree(SUN_TIFF_NATIVE_STREAM_FORMAT,
root);
+ streamMetadata.setFromTree(format, root);
} catch (IIOInvalidTreeException e) {
//This should not happen since we check if the format is
supported.
throw new IllegalStateException(
"Could not replace TIFF stream metadata: " +
e.getMessage(), e);
}
}
- return streamMetadata;
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xmlgraphics-commons-2.3/src/main/java/org/apache/xmlgraphics/java2d/GraphicsConfigurationWithTransparency.java
new/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/java2d/GraphicsConfigurationWithTransparency.java
---
old/xmlgraphics-commons-2.3/src/main/java/org/apache/xmlgraphics/java2d/GraphicsConfigurationWithTransparency.java
2018-05-14 11:00:43.000000000 +0200
+++
new/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/java2d/GraphicsConfigurationWithTransparency.java
2019-10-25 10:01:30.000000000 +0200
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: GraphicsConfigurationWithTransparency.java 1732018 2016-02-24
04:51:06Z gadams $ */
+/* $Id: GraphicsConfigurationWithTransparency.java 1862543 2019-07-04
09:25:38Z ssteiner $ */
package org.apache.xmlgraphics.java2d;
@@ -73,7 +73,7 @@
* @return the bounds of the document page
*/
public Rectangle getBounds() {
- return null;
+ return new Rectangle();
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xmlgraphics-commons-2.3/src/main/java/org/apache/xmlgraphics/java2d/GraphicsConfigurationWithoutTransparency.java
new/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/java2d/GraphicsConfigurationWithoutTransparency.java
---
old/xmlgraphics-commons-2.3/src/main/java/org/apache/xmlgraphics/java2d/GraphicsConfigurationWithoutTransparency.java
2018-05-14 11:00:43.000000000 +0200
+++
new/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/java2d/GraphicsConfigurationWithoutTransparency.java
2019-10-25 10:01:30.000000000 +0200
@@ -84,6 +84,6 @@
@Override
public Rectangle getBounds() {
- return null;
+ return new Rectangle();
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xmlgraphics-commons-2.3/src/main/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java
new/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java
---
old/xmlgraphics-commons-2.3/src/main/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java
2018-05-14 11:00:43.000000000 +0200
+++
new/xmlgraphics-commons-2.4/src/main/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java
2019-10-25 10:01:30.000000000 +0200
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: PSGraphics2D.java 1809627 2017-09-25 13:42:08Z ssteiner $ */
+/* $Id: PSGraphics2D.java 1845492 2018-11-01 15:54:06Z ssteiner $ */
package org.apache.xmlgraphics.java2d.ps;
@@ -23,6 +23,7 @@
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Color;
+import java.awt.Composite;
import java.awt.Dimension;
import java.awt.GradientPaint;
import java.awt.Graphics;
@@ -60,7 +61,7 @@
* therefore of <tt>Graphics2D</tt>) which is able to generate PostScript
* code.
*
- * @version $Id: PSGraphics2D.java 1809627 2017-09-25 13:42:08Z ssteiner $
+ * @version $Id: PSGraphics2D.java 1845492 2018-11-01 15:54:06Z ssteiner $
* @see org.apache.xmlgraphics.java2d.AbstractGraphics2D
*
* Originally authored by Keiron Liddle.
@@ -787,35 +788,42 @@
* @see #setClip
*/
public void fill(Shape s) {
- preparePainting();
- try {
- gen.saveGraphicsState();
+ if (!hasAlpha()) {
+ preparePainting();
+ try {
+ gen.saveGraphicsState();
- AffineTransform trans = getTransform();
- boolean newTransform = !trans.isIdentity();
+ AffineTransform trans = getTransform();
+ boolean newTransform = !trans.isIdentity();
- if (newTransform) {
- gen.concatMatrix(trans);
- }
- Shape imclip = getClip();
- if (shouldBeClipped(imclip, s)) {
- writeClip(imclip);
- }
+ if (newTransform) {
+ gen.concatMatrix(trans);
+ }
+ Shape imclip = getClip();
+ if (shouldBeClipped(imclip, s)) {
+ writeClip(imclip);
+ }
- establishColor(getColor());
+ establishColor(getColor());
- applyPaint(getPaint(), true);
+ applyPaint(getPaint(), true);
- gen.writeln(gen.mapCommand("newpath"));
- int windingRule = processShape(s, true);
- doDrawing(true, false,
+ gen.writeln(gen.mapCommand("newpath"));
+ int windingRule = processShape(s, true);
+ doDrawing(true, false,
windingRule == PathIterator.WIND_EVEN_ODD);
- gen.restoreGraphicsState();
- } catch (IOException ioe) {
- handleIOException(ioe);
+ gen.restoreGraphicsState();
+ } catch (IOException ioe) {
+ handleIOException(ioe);
+ }
}
}
+ private boolean hasAlpha() {
+ Composite composite = getComposite();
+ return composite instanceof AlphaComposite && ((AlphaComposite)
composite).getAlpha() == 0f;
+ }
+
/**
* Commits a painting operation.
* @param fill filling
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xmlgraphics-commons-2.3/src/test/java/org/apache/xmlgraphics/image/loader/impl/PNGFileTestCase.java
new/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/image/loader/impl/PNGFileTestCase.java
---
old/xmlgraphics-commons-2.3/src/test/java/org/apache/xmlgraphics/image/loader/impl/PNGFileTestCase.java
2018-05-14 11:00:43.000000000 +0200
+++
new/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/image/loader/impl/PNGFileTestCase.java
2019-10-25 10:01:30.000000000 +0200
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: PNGFileTestCase.java 1732019 2016-02-24 05:01:10Z gadams $ */
+/* $Id: PNGFileTestCase.java 1843559 2018-10-11 14:59:17Z ssteiner $ */
package org.apache.xmlgraphics.image.loader.impl;
@@ -28,7 +28,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import org.apache.xmlgraphics.image.loader.ImageContext;
import org.apache.xmlgraphics.image.loader.ImageException;
@@ -77,12 +76,13 @@
ImageSessionContext session = new MockImageSessionContext(context);
ImageInfo info = new ImageInfo("corrupt-image.png",
MimeConstants.MIME_PNG);
ImageLoaderRawPNG ilrpng = new ImageLoaderRawPNG();
+ String exception = "";
try {
- ImageRawPNG irpng = (ImageRawPNG) ilrpng.loadImage(info, null,
session);
- fail("An exception should have been thrown above");
+ ilrpng.loadImage(info, null, session);
} catch (Exception e) {
- // do nothing; this was expected
+ exception = e.getCause().getMessage();
}
+ assertEquals("PNG unknown critical chunk: IBLA", exception);
}
private void testColorTypePNG(String imageName, int colorType) throws
ImageException, IOException {
@@ -115,5 +115,4 @@
assertTrue(irpng.isTransparent());
}
}
-
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xmlgraphics-commons-2.3/src/test/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriterTestCase.java
new/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriterTestCase.java
---
old/xmlgraphics-commons-2.3/src/test/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriterTestCase.java
2018-05-14 11:00:43.000000000 +0200
+++
new/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriterTestCase.java
2019-10-25 10:01:30.000000000 +0200
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: ImageIOTIFFImageWriterTestCase.java 1732019 2016-02-24 05:01:10Z
gadams $ */
+/* $Id: ImageIOTIFFImageWriterTestCase.java 1833700 2018-06-18 10:08:45Z
ssteiner $ */
package org.apache.xmlgraphics.image.writer.imageio;
@@ -27,9 +27,14 @@
import java.awt.image.BufferedImage;
import java.io.IOException;
+import javax.imageio.metadata.IIOMetadata;
+import javax.imageio.metadata.IIOMetadataNode;
+
import org.junit.Assert;
import org.junit.Test;
+import org.w3c.dom.Node;
+
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.xmlgraphics.image.loader.ImageSize;
@@ -126,7 +131,7 @@
ByteArrayOutputStream getByteArrayOutput();
}
- private class TestImageWriter implements ImageWriterHelper {
+ private static class TestImageWriter implements ImageWriterHelper {
private ImageWriter writer;
private ByteArrayOutputStream baout;
@@ -149,7 +154,7 @@
}
}
- private class TestMultiImageWriter implements ImageWriterHelper {
+ private static class TestMultiImageWriter implements ImageWriterHelper {
private MultiImageWriter writer;
private ByteArrayOutputStream baout;
@@ -176,4 +181,32 @@
}
}
+ @Test
+ public void testNewMetadataFormat() {
+ ImageWriterParams params = new ImageWriterParams();
+ params.setResolution(92);
+ MyIIOMetadata metadata = new MyIIOMetadata();
+ new ImageIOTIFFImageWriter().updateMetadata(null, metadata, params);
+ Assert.assertEquals(metadata.mergeNode,
"javax_imageio_tiff_image_1.0");
+ }
+
+ static class MyIIOMetadata extends IIOMetadata {
+ String mergeNode;
+ MyIIOMetadata() {
+ super(true, "javax_imageio_tiff_image_1.0", null, null, null);
+ }
+ public boolean isReadOnly() {
+ return false;
+ }
+ public Node getAsTree(String formatName) {
+ IIOMetadataNode node = new IIOMetadataNode();
+ node.appendChild(new IIOMetadataNode("Dimension"));
+ return node;
+ }
+ public void mergeTree(String formatName, Node root) {
+ mergeNode = root.getNodeName();
+ }
+ public void reset() {
+ }
+ };
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xmlgraphics-commons-2.3/src/test/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2DTestCase.java
new/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2DTestCase.java
---
old/xmlgraphics-commons-2.3/src/test/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2DTestCase.java
2018-05-14 11:00:43.000000000 +0200
+++
new/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2DTestCase.java
2019-10-25 10:01:30.000000000 +0200
@@ -15,10 +15,11 @@
* limitations under the License.
*/
-/* $Id: PSGraphics2DTestCase.java 1809627 2017-09-25 13:42:08Z ssteiner $ */
+/* $Id: PSGraphics2DTestCase.java 1845492 2018-11-01 15:54:06Z ssteiner $ */
package org.apache.xmlgraphics.java2d.ps;
+import java.awt.AlphaComposite;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.TexturePaint;
@@ -161,4 +162,18 @@
assertTrue(out.toString().contains("1 1 4 matrix\n{<\nfff\n>} false 3
colorimage"));
p.dispose();
}
+
+ @Test
+ public void testFillAlpha() {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ PSGenerator gen = new PSGenerator(out);
+ PSGraphics2D p = new PSGraphics2D(false, gen);
+ p.setGraphicContext(new GraphicContext());
+ p.setComposite(AlphaComposite.getInstance(3, 0));
+ p.fill(new Rectangle());
+ assertEquals(out.toString(), "");
+ p.setComposite(AlphaComposite.getInstance(3, 0.5f));
+ p.fill(new Rectangle());
+ assertTrue(out.toString().contains("\nN\n"));
+ }
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xmlgraphics-commons-2.3/src/test/java/org/apache/xmlgraphics/ps/PSPageDeviceDictionaryTestCase.java
new/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/ps/PSPageDeviceDictionaryTestCase.java
---
old/xmlgraphics-commons-2.3/src/test/java/org/apache/xmlgraphics/ps/PSPageDeviceDictionaryTestCase.java
2018-05-14 11:00:43.000000000 +0200
+++
new/xmlgraphics-commons-2.4/src/test/java/org/apache/xmlgraphics/ps/PSPageDeviceDictionaryTestCase.java
2019-10-25 10:01:30.000000000 +0200
@@ -19,10 +19,9 @@
import java.util.HashMap;
import java.util.Map;
+import org.junit.Assert;
import org.junit.Test;
-import junit.framework.Assert;
-
public class PSPageDeviceDictionaryTestCase {
@Test
public void testPSPageDeviceDictionary() {