deweese 2003/12/17 17:36:39 Modified: samples/tests/spec/color colorProfile.svg sources/org/apache/batik/css/parser Parser.java sources/org/apache/batik/ext/awt/image/spi JPEGRegistryEntry.java sources/org/apache/batik/util ParsedURLData.java Log: 1) Now supports CSS properties with the max negative 32bit int value (Bug #25251) 2) Supports more JPEG types. 3) Support deflate compressed streams in addtion to gzip. PR: 25251 Revision Changes Path 1.6 +2 -15 xml-batik/samples/tests/spec/color/colorProfile.svg Index: colorProfile.svg =================================================================== RCS file: /home/cvs/xml-batik/samples/tests/spec/color/colorProfile.svg,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- colorProfile.svg 8 Aug 2003 11:39:31 -0000 1.5 +++ colorProfile.svg 18 Dec 2003 01:36:39 -0000 1.6 @@ -101,19 +101,6 @@ <rect x="100" y="25" width="25" height="25" fill="rgb(255, 255, 255)" /> </g> - <g id="testColorsICCAuto"> - <rect x="0" y="0" width="25" height="25" fill="rgb(179, 70, 25) icc-color(colorChange, 0.702, 0.2745, 0.098)" /> - <rect x="25" y="0" width="25" height="25" fill="rgb(138, 237, 76) icc-color(colorChange, 0.5412, 0.9294, 0.298)" /> - <rect x="50" y="0" width="25" height="25" fill="rgb(88, 35, 244) icc-color(colorChange, 0.3451, 0.1373, 0.9569)" /> - <rect x="75" y="0" width="25" height="25" fill="rgb(168, 241, 253) icc-color(colorChange, 0.6588, 0.9451, 0.9922)" /> - <rect x="100" y="0" width="25" height="25" fill="rgb(205, 81, 242) icc-color(colorChange, 0.8039, 0.3176, 0.949)" /> - <rect x="0" y="25" width="25" height="25" fill="rgb(234, 251, 82) icc-color(colorChange, 0.9176, 0.9843, 0.3216)" /> - <rect x="25" y="25" width="25" height="25" fill="rgb(0, 0, 0) icc-color(colorChange, 0.0, 0.0, 0.0)" /> - <rect x="50" y="25" width="25" height="25" fill="rgb(109, 109, 109) icc-color(colorChange, 0.4275, 0.4275, 0.4275)" /> - <rect x="75" y="25" width="25" height="25" fill="rgb(188, 188, 188) icc-color(colorChange, 0.7373, 0.7373, 0.7373)" /> - <rect x="100" y="25" width="25" height="25" fill="rgb(255, 255, 255) icc-color(colorChange, 1.0, 1.0, 1.0)" /> - </g> - <color-profile name="changeColorAuto" rendering-intent="auto" xlink:href="../../resources/icc/changeColor.icm"/> @@ -280,7 +267,7 @@ <rect x="75" y="0" width="25" height="25" fill="rgb(168, 241, 253) icc-color(changeColorAuto, 0.6588, 0.9451, 0.9922)" /> <rect x="100" y="0" width="25" height="25" fill="rgb(205, 81, 242) icc-color(changeColorAuto, 0.8039, 0.3176, 0.949)" /> <rect x="0" y="25" width="25" height="25" fill="rgb(234, 251, 82) icc-color(changeColorAuto, 0.9176, 0.9843, 0.3216)" /> - <rect x="25" y="25" width="25" height="25" fill="rgb(0, 0, 0) icc-color(changeColorAuto, 0.0, 0.0, 0.0)" /> + <rect x="25" y="25" width="25" height="25" fill="red icc-color(changeColorAuto, 0.0, 0.0, 0.0)" /> <rect x="50" y="25" width="25" height="25" fill="rgb(109, 109, 109) icc-color(changeColorAuto, 0.4275, 0.4275, 0.4275)" /> <rect x="75" y="25" width="25" height="25" fill="rgb(188, 188, 188) icc-color(changeColorAuto, 0.7373, 0.7373, 0.7373)" /> <rect x="100" y="25" width="25" height="25" fill="rgb(255, 255, 255) icc-color(changeColorAuto, 1.0, 1.0, 1.0)" /> 1.26 +4 -3 xml-batik/sources/org/apache/batik/css/parser/Parser.java Index: Parser.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/css/parser/Parser.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- Parser.java 20 Nov 2003 10:58:49 -0000 1.25 +++ Parser.java 18 Dec 2003 01:36:39 -0000 1.26 @@ -978,8 +978,9 @@ default: switch (current) { case LexicalUnits.INTEGER: - int s = (plus) ? 1 : -1; - int val = s * Integer.parseInt(scanner.getStringValue()); + String sval = scanner.getStringValue(); + if (!plus) sval = "-"+sval; + int val = Integer.parseInt(sval); nextIgnoreSpaces(); return CSSLexicalUnit.createInteger(val, prev); case LexicalUnits.REAL: 1.14 +3 -6 xml-batik/sources/org/apache/batik/ext/awt/image/spi/JPEGRegistryEntry.java Index: JPEGRegistryEntry.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/spi/JPEGRegistryEntry.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- JPEGRegistryEntry.java 8 Aug 2003 11:39:09 -0000 1.13 +++ JPEGRegistryEntry.java 18 Dec 2003 01:36:39 -0000 1.14 @@ -73,15 +73,12 @@ public class JPEGRegistryEntry extends MagicNumberRegistryEntry { - static final byte [] sigJFIF = {(byte)0xFF, (byte)0xd8, - (byte)0xFF, (byte)0xe0}; - static final byte [] sigEXIF = {(byte)0xFF, (byte)0xd8, - (byte)0xFF, (byte)0xe1}; + static final byte [] sigJPEG = {(byte)0xFF, (byte)0xd8, + (byte)0xFF}; static final String [] exts = {"jpeg", "jpg" }; static final String [] mimeTypes = {"image/jpeg", "image/jpg" }; static final MagicNumber [] magicNumbers = { - new MagicNumber(0, sigJFIF), - new MagicNumber(0, sigEXIF) + new MagicNumber(0, sigJPEG) }; public JPEGRegistryEntry() { 1.14 +30 -1 xml-batik/sources/org/apache/batik/util/ParsedURLData.java Index: ParsedURLData.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/util/ParsedURLData.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- ParsedURLData.java 16 Sep 2003 01:12:53 -0000 1.13 +++ ParsedURLData.java 18 Dec 2003 01:36:39 -0000 1.14 @@ -61,6 +61,8 @@ import java.util.LinkedList; import java.util.List; import java.util.zip.GZIPInputStream; +import java.util.zip.InflaterInputStream; +import java.util.zip.ZipException; /** * Holds the data for more URL's @@ -111,6 +113,33 @@ if ((data[0] == GZIP_MAGIC[0]) && (data[1] == GZIP_MAGIC[1])) return new GZIPInputStream(is); + + if (((data[0]&0x0F) == 8) && + ((data[0]>>>4) <= 7)) { + // Check for a zlib (deflate) stream + int chk = ((((int)data[0])&0xFF)*256+ + (((int)data[1])&0xFF)); + if ((chk %31) == 0) { + try { + // I'm not really as certain of this check + // as I would like so I want to force it + // to decode part of the stream. + is.mark(100); + InputStream ret = new InflaterInputStream(is); + if (!ret.markSupported()) + ret = new BufferedInputStream(ret); + ret.mark(2); + ret.read(data); + is.reset(); + ret = new InflaterInputStream(is); + return ret; + } catch (ZipException ze) { + is.reset(); + return is; + } + } + } + return is; }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]