Skip to content
Commits on Source (13)
Apache XML Graphics Commons
Copyright 2006-2017 The Apache Software Foundation
Copyright 2006-2018 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
$Id: README 1786918 2017-03-14 15:58:56Z ssteiner $
$Id: README 1831544 2018-05-14 08:05:15Z ssteiner $
==============================================================================
APACHE XML GRAPHICS COMMONS - README
......@@ -82,6 +82,11 @@ License labeling (according to http://www.apache.org/legal/3party.html):
For more detailed info about the changes, please see:
http://xmlgraphics.apache.org/commons/changes.html
Version 2.3
--------------
Minor release to be used with FOP 2.3
Version 2.2
--------------
......
......@@ -34,7 +34,7 @@
## ===================================================================
## 3. Project specific properties
version = 2.2
version = 2.3
## Allows you to switch off the compilation of the internal image
## codecs which depend on Sun-private classes. Setting this to true
......
......@@ -25,13 +25,13 @@
<property name="Name" value="Apache XML Graphics Commons"/>
<property name="name" value="xmlgraphics-commons"/>
<property name="year" value="1999-2017"/>
<property name="year" value="1999-2018"/>
<property name="javac.debug" value="on"/>
<property name="javac.optimize" value="off"/>
<property name="javac.deprecation" value="on"/>
<property name="javac.source" value="1.5"/>
<property name="javac.target" value="1.5"/>
<property name="javac.source" value="1.6"/>
<property name="javac.target" value="1.6"/>
<property name="javac.fork" value="no"/>
<property name="junit.fork" value="on"/>
......@@ -555,28 +555,28 @@ NOTE:
<!--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"/>
<antcall target="md5">
<antcall target="sha512">
<param name="sign.archive" value="${name}-${version}-src.zip"/>
</antcall>
<antcall target="sign-file">
<param name="sign.archive" value="${name}-${version}-src.zip"/>
<param name="pwd" value="${pwd}"/>
</antcall>
<antcall target="md5">
<antcall target="sha512">
<param name="sign.archive" value="${name}-${version}-src.tar.gz"/>
</antcall>
<antcall target="sign-file">
<param name="sign.archive" value="${name}-${version}-src.tar.gz"/>
<param name="pwd" value="${pwd}"/>
</antcall>
<antcall target="md5">
<antcall target="sha512">
<param name="sign.archive" value="${name}-${version}-${bin.suffix}.zip"/>
</antcall>
<antcall target="sign-file">
<param name="sign.archive" value="${name}-${version}-${bin.suffix}.zip"/>
<param name="pwd" value="${pwd}"/>
</antcall>
<antcall target="md5">
<antcall target="sha512">
<param name="sign.archive" value="${name}-${version}-${bin.suffix}.tar.gz"/>
</antcall>
<antcall target="sign-file">
......@@ -585,11 +585,11 @@ NOTE:
</antcall>
</target>
<target name="md5">
<property name="md5.exec" value="md5sum"/>
<property name="md5.options" value=""/>
<exec executable="${md5.exec}" output="${sign.archive}.md5">
<arg line="${md5.options} ${sign.archive}"/>
<target name="sha512">
<property name="sha512.exec" value="sha512sum"/>
<property name="sha512.options" value=""/>
<exec executable="${sha512.exec}" output="${sign.archive}.sha512">
<arg line="${sha512.options} ${sign.archive}"/>
</exec>
</target>
......@@ -619,10 +619,7 @@ NOTE:
<include name="maven/pom.xml"/>
</patternset>
</fileset>
<checksum algorithm="md5">
<fileset refid="bundle-files"/>
</checksum>
<checksum algorithm="sha1">
<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"/>
......
xmlgraphics-commons
-------------------
Source tarball:
---------------
The lib/*.jar files were removed, as provided only in binary form, and
the examples/ subdirectory was removed, as it contained files of dubious
copyright status (some PDF files, for instance).
Please see the debian/new-upstream script for details on how that did
happen.
-- Vincent Fourmond <fourmond@debian.org> Mon, 13 Oct 2008 21:47:24 +0200
xmlgraphics-commons (2.3-1) unstable; urgency=medium
* Team upload.
* New upstream version 2.3.
- Apparently all tests run successfully again. (Closes: #906523)
* Switch to compat level 11.
* Declare compliance with Debian Policy 4.2.0.
* Remove README.source. Obsolete.
* Remove Vincent Fourmond from Uploaders at this own request.
(Closes: #897314)
* Remove all patches because they were disabled and not used at all.
-- Markus Koschany <apo@debian.org> Wed, 22 Aug 2018 23:30:39 +0200
xmlgraphics-commons (2.2-1) unstable; urgency=medium
* Team upload.
......
......@@ -3,10 +3,9 @@ Section: java
Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
Uploaders:
Vincent Fourmond <fourmond@debian.org>,
Mathieu Malaterre <malat@debian.org>
Build-Depends:
debhelper (>= 10),
debhelper (>= 11),
default-jdk,
default-jdk-doc,
gnupg,
......@@ -17,7 +16,7 @@ Build-Depends:
libmockito-java,
libxml-commons-resolver1.1-java,
maven-debian-helper (>= 2.2)
Standards-Version: 4.1.1
Standards-Version: 4.2.0
Vcs-Git: https://anonscm.debian.org/git/pkg-java/xmlgraphics-commons.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/xmlgraphics-commons.git
Homepage: http://xmlgraphics.apache.org/commons/
......
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: xmlgraphics-commons
Upstream-Contact: Chris Bowditch, Thomas DeWeese, Christian Geisert,
Clay Leeds, Jeremias Märki, Cameron McCormack, Simon Pepping, Jörg
......
pom.xml --has-package-version --java-lib
pom.xml --java-lib
Description: This test fails with openjdk-7 (and oracle java 7).
Skip for the time being until upstream resolve - see Bug.
Author: James Page <james.page@ubuntu.com>
Bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=53328
#xml-top-level.patch
#xml-rdf-resource.patch
Description: ignores rdf:resource in XMP
Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=xml-rdf-resource.patch;att=1;bug=605941
Bug-Debian: http://bugs.debian.org/605941
Author: brian m. carlson <sandals@crustytoothpaste.net>
Index: xmlgraphics-commons-1.4.dfsg/src/java/org/apache/xmlgraphics/xmp/XMPArray.java
===================================================================
--- xmlgraphics-commons-1.4.dfsg.orig/src/java/org/apache/xmlgraphics/xmp/XMPArray.java 2010-12-20 21:38:39.387336352 +0100
+++ xmlgraphics-commons-1.4.dfsg/src/java/org/apache/xmlgraphics/xmp/XMPArray.java 2010-12-20 21:39:14.891670733 +0100
@@ -19,6 +19,8 @@
package org.apache.xmlgraphics.xmp;
+import java.net.URI;
+
import java.util.List;
import org.xml.sax.ContentHandler;
@@ -216,15 +218,19 @@
for (int i = 0, c = values.size(); i < c; i++) {
String lang = (String)xmllang.get(i);
atts.clear();
+ Object v = values.get(i);
if (lang != null) {
atts.addAttribute(XMPConstants.XML_NS, "lang", "xml:lang", "CDATA", lang);
}
+ if (v instanceof URI) {
+ atts.addAttribute(XMPConstants.RDF_NAMESPACE, "resource",
+ "rdf:resource", "CDATA", ((URI)v).toString());
+ }
handler.startElement(XMPConstants.RDF_NAMESPACE,
"li", "rdf:li", atts);
- Object v = values.get(i);
if (v instanceof XMPComplexValue) {
((XMPComplexValue)v).toSAX(handler);
- } else {
+ } else if (!(v instanceof URI)) {
String value = (String)values.get(i);
char[] chars = value.toCharArray();
handler.characters(chars, 0, chars.length);
Index: xmlgraphics-commons-1.4.dfsg/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java
===================================================================
--- xmlgraphics-commons-1.4.dfsg.orig/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java 2010-12-20 21:39:04.295336685 +0100
+++ xmlgraphics-commons-1.4.dfsg/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java 2010-12-20 21:39:14.891670733 +0100
@@ -19,6 +19,9 @@
package org.apache.xmlgraphics.xmp;
+import java.net.URI;
+import java.net.URISyntaxException;
+
import java.util.Stack;
import org.xml.sax.Attributes;
@@ -233,6 +236,15 @@
} else {
getCurrentArray(true).add(s);
}
+ } else {
+ String res = atts.getValue(XMPConstants.RDF_NAMESPACE,
+ "resource");
+ try {
+ URI resource = new URI(res);
+ getCurrentArray(true).add(resource);
+ } catch (URISyntaxException e) {
+ throw new SAXException("rdf:resource value is not a well-formed URI", e);
+ }
}
}
} else if ("Description".equals(localName)) {
@@ -267,9 +279,18 @@
String s = content.toString().trim();
prop = new XMPProperty(name, s);
String lang = atts.getValue(XMPConstants.XML_NS, "lang");
+ String res = atts.getValue(XMPConstants.RDF_NAMESPACE, "resource");
if (lang != null) {
prop.setXMLLang(lang);
}
+ if (res != null) {
+ try {
+ URI resource = new URI(res);
+ prop.setValue(resource);
+ } catch (URISyntaxException e) {
+ throw new SAXException("rdf:resource value is not a well-formed URI", e);
+ }
+ }
}
if (prop.getName() == null) {
throw new IllegalStateException("No content in XMP property");
Index: xmlgraphics-commons-1.4.dfsg/src/java/org/apache/xmlgraphics/xmp/XMPProperty.java
===================================================================
--- xmlgraphics-commons-1.4.dfsg.orig/src/java/org/apache/xmlgraphics/xmp/XMPProperty.java 2010-12-20 21:38:39.403336472 +0100
+++ xmlgraphics-commons-1.4.dfsg/src/java/org/apache/xmlgraphics/xmp/XMPProperty.java 2010-12-20 21:39:14.891670733 +0100
@@ -19,6 +19,8 @@
package org.apache.xmlgraphics.xmp;
+import java.net.URI;
+
import java.util.Iterator;
import java.util.Map;
@@ -38,6 +40,7 @@
private Object value;
private String xmllang;
private Map qualifiers;
+ private boolean uri;
/**
* Creates a new XMP property.
@@ -47,6 +50,7 @@
public XMPProperty(QName name, Object value) {
this.name = name;
this.value = value;
+ this.uri = false;
}
/** @return the qualified name of the property (namespace URI + local name) */
@@ -192,12 +196,15 @@
public void toSAX(ContentHandler handler) throws SAXException {
AttributesImpl atts = new AttributesImpl();
String qName = getEffectiveQName();
+ if (value instanceof URI) {
+ atts.addAttribute(XMPConstants.RDF_NAMESPACE, "resource", "rdf:resource", "CDATA", ((URI)value).toString());
+ }
handler.startElement(getName().getNamespaceURI(),
getName().getLocalName(), qName, atts);
if (value instanceof XMPComplexValue) {
XMPComplexValue cv = ((XMPComplexValue)value);
cv.toSAX(handler);
- } else {
+ } else if (!(value instanceof URI)) {
char[] chars = value.toString().toCharArray();
handler.characters(chars, 0, chars.length);
}
Description: handles top-level elements in XMP poorly
Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=xml-top-level.patch;att=1;bug=605940
Bug-Debian: http://bugs.debian.org/605940
Author: brian m. carlson <sandals@crustytoothpaste.net>
Index: xmlgraphics-commons-1.4.dfsg/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java
===================================================================
--- xmlgraphics-commons-1.5.orig/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java 2012-10-16 19:54:12.000000000 +0000
+++ xmlgraphics-commons-1.5/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java 2012-10-29 08:07:29.898012902 +0000
@@ -187,6 +187,12 @@
throw new SAXException("Unexpected element in the RDF namespace: " + localName);
}
} else {
+ String about = attributes.getValue(XMPConstants.RDF_NAMESPACE, "about");
+ if (this.contextStack.peek().equals(this.meta) && (about != null)) {
+ //rdf:RDF is the parent, so this is a top-level item that isn't
+ //an rdf:Description, which isn't allowed.
+ throw new SAXException("Top-level element " + qName + " not an rdf:Description");
+ }
if (getCurrentPropName() != null) {
//Structure (shorthand form)
startStructure();
......@@ -4,14 +4,14 @@
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>xmlgraphics-commons</artifactId>
<version>2.2</version>
<version>2.3</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>XML Graphics Commons</description>
<properties>
<checkstyle.version>2.15</checkstyle.version>
<exec.version>1.4.0</exec.version>
<findbugs.version>2.5.5</findbugs.version>
<findbugs.version>3.0.4</findbugs.version>
<java.version>1.6</java.version>
<junit.version>4.11</junit.version>
<project.info.reports.version>2.8</project.info.reports.version>
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
/* $Id: Glyphs.java 1681108 2015-05-22 13:26:12Z ssteiner $ */
/* $Id: Glyphs.java 1804124 2017-08-04 14:13:54Z ssteiner $ */
package org.apache.xmlgraphics.fonts;
......@@ -680,8 +680,8 @@ public final class Glyphs {
String[] arr = new String[lines.size() * 2];
int pos = 0;
StringBuffer buf = new StringBuffer();
for (int i = 0, c = lines.size(); i < c; i++) {
String line = (String)lines.get(i);
for (Object line1 : lines) {
String line = (String) line1;
int semicolon = line.indexOf(';');
if (semicolon <= 0) {
continue;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
/* $Id: PNGImageEncoder.java 1732018 2016-02-24 04:51:06Z gadams $ */
/* $Id: PNGImageEncoder.java 1804124 2017-08-04 14:13:54Z ssteiner $ */
package org.apache.xmlgraphics.image.codec.png;
......@@ -601,9 +601,8 @@ public class PNGImageEncoder extends ImageEncoderImpl {
ChunkStream cs = new ChunkStream("sBIT");
try {
int[] significantBits = param.getSignificantBits();
int len = significantBits.length;
for (int i = 0; i < len; i++) {
cs.writeByte(significantBits[i]);
for (int significantBit : significantBits) {
cs.writeByte(significantBit);
}
cs.writeToStream(dataOutput);
} finally {
......@@ -682,8 +681,8 @@ public class PNGImageEncoder extends ImageEncoderImpl {
ChunkStream cs = new ChunkStream("hIST");
try {
int[] hist = param.getPaletteHistogram();
for (int i = 0; i < hist.length; i++) {
cs.writeShort(hist[i]);
for (int aHist : hist) {
cs.writeShort(aHist);
}
cs.writeToStream(dataOutput);
......@@ -702,8 +701,8 @@ public class PNGImageEncoder extends ImageEncoderImpl {
if (param instanceof PNGEncodeParam.Palette) {
byte[] t =
((PNGEncodeParam.Palette)param).getPaletteTransparency();
for (int i = 0; i < t.length; i++) {
cs.writeByte(t[i]);
for (byte aT : t) {
cs.writeByte(aT);
}
} else if (param instanceof PNGEncodeParam.Gray) {
int t = ((PNGEncodeParam.Gray)param).getTransparentGray();
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
/* $Id: TIFFImageEncoder.java 1732018 2016-02-24 04:51:06Z gadams $ */
/* $Id: TIFFImageEncoder.java 1804124 2017-08-04 14:13:54Z ssteiner $ */
package org.apache.xmlgraphics.image.codec.tiff;
......@@ -382,15 +382,11 @@ public class TIFFImageEncoder extends ImageEncoderImpl {
// Add extra fields specified via the encoding parameters.
TIFFField[] extraFields = encodeParam.getExtraFields();
List extantTags = new ArrayList(fields.size());
Iterator fieldIter = fields.iterator();
while (fieldIter.hasNext()) {
TIFFField fld = (TIFFField)fieldIter.next();
for (TIFFField fld : fields) {
extantTags.add(fld.getTag());
}
int numExtraFields = extraFields.length;
for (int i = 0; i < numExtraFields; i++) {
TIFFField fld = extraFields[i];
for (TIFFField fld : extraFields) {
Integer tagValue = fld.getTag();
if (!extantTags.contains(tagValue)) {
fields.add(fld);
......@@ -1003,10 +999,9 @@ public class TIFFImageEncoder extends ImageEncoderImpl {
int dirSize = 2 + numEntries * 12 + 4;
// Loop over fields adding the size of all values > 4 bytes.
Iterator iter = fields.iterator();
while (iter.hasNext()) {
for (Object field1 : fields) {
// Get the field.
TIFFField field = (TIFFField)iter.next();
TIFFField field = (TIFFField) field1;
// Determine the size of the field value.
int valueSize = field.getCount() * SIZE_OF_TYPE[field.getType()];
......@@ -1048,11 +1043,10 @@ public class TIFFImageEncoder extends ImageEncoderImpl {
// Write number of fields in the IFD
writeUnsignedShort(numEntries);
Iterator iter = fields.iterator();
while (iter.hasNext()) {
for (Object field1 : fields) {
// 12 byte field entry TIFFField
TIFFField field = (TIFFField)iter.next();
TIFFField field = (TIFFField) field1;
// byte 0-1 Tag that identifies a field
int tag = field.getTag();
......@@ -1086,8 +1080,8 @@ public class TIFFImageEncoder extends ImageEncoderImpl {
writeLong(nextIFDOffset);
// Write the tag values that did not fit into 4 bytes
for (int i = 0; i < tooBig.size(); i++) {
writeValues((TIFFField)tooBig.get(i));
for (Object aTooBig : tooBig) {
writeValues((TIFFField) aTooBig);
}
}
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
/* $Id: TIFFLZWDecoder.java 1732018 2016-02-24 04:51:06Z gadams $ */
/* $Id: TIFFLZWDecoder.java 1804124 2017-08-04 14:13:54Z ssteiner $ */
package org.apache.xmlgraphics.image.codec.tiff;
......@@ -170,8 +170,8 @@ public class TIFFLZWDecoder {
*/
public void writeString(byte[] string) {
for (int i = 0; i < string.length; i++) {
uncompData[dstIndex++] = string[i];
for (byte aString : string) {
uncompData[dstIndex++] = aString;
}
}
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
/* $Id: SimpleRenderedImage.java 1732018 2016-02-24 04:51:06Z gadams $ */
/* $Id: SimpleRenderedImage.java 1804124 2017-08-04 14:13:54Z ssteiner $ */
package org.apache.xmlgraphics.image.codec.util;
......@@ -46,7 +46,7 @@ import java.util.Vector;
* purpose, but in the interest of modularity the
* use of <code>PlanarImage</code> has been avoided.
*
* @version $Id: SimpleRenderedImage.java 1732018 2016-02-24 04:51:06Z gadams $
* @version $Id: SimpleRenderedImage.java 1804124 2017-08-04 14:13:54Z ssteiner $
*/
public abstract class SimpleRenderedImage implements RenderedImage {
......@@ -273,9 +273,9 @@ public abstract class SimpleRenderedImage implements RenderedImage {
prefix = prefix.toLowerCase(Locale.getDefault());
List names = new ArrayList();
for (int i = 0; i < propertyNames.length; i++) {
if (propertyNames[i].startsWith(prefix)) {
names.add(propertyNames[i]);
for (String propertyName : propertyNames) {
if (propertyName.startsWith(prefix)) {
names.add(propertyName);
}
}
......