You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2011/12/19 18:27:32 UTC
svn commit: r1220868 [2/4] - in /commons/proper/sanselan/trunk/src:
main/java/org/apache/commons/sanselan/
main/java/org/apache/commons/sanselan/color/
main/java/org/apache/commons/sanselan/common/
main/java/org/apache/commons/sanselan/common/mylzw/ ma...
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/JpegImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/JpegImageParser.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/JpegImageParser.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/JpegImageParser.java Mon Dec 19 17:27:28 2011
@@ -37,15 +37,15 @@ import org.apache.commons.sanselan.Image
import org.apache.commons.sanselan.common.IImageMetadata;
import org.apache.commons.sanselan.common.bytesource.ByteSource;
import org.apache.commons.sanselan.formats.jpeg.decoder.JpegDecoder;
-import org.apache.commons.sanselan.formats.jpeg.iptc.IPTCParser;
+import org.apache.commons.sanselan.formats.jpeg.iptc.IptcParser;
import org.apache.commons.sanselan.formats.jpeg.iptc.PhotoshopApp13Data;
import org.apache.commons.sanselan.formats.jpeg.segments.App13Segment;
import org.apache.commons.sanselan.formats.jpeg.segments.App2Segment;
-import org.apache.commons.sanselan.formats.jpeg.segments.COMSegment;
-import org.apache.commons.sanselan.formats.jpeg.segments.DQTSegment;
+import org.apache.commons.sanselan.formats.jpeg.segments.ComSegment;
+import org.apache.commons.sanselan.formats.jpeg.segments.DqtSegment;
import org.apache.commons.sanselan.formats.jpeg.segments.GenericSegment;
-import org.apache.commons.sanselan.formats.jpeg.segments.JFIFSegment;
-import org.apache.commons.sanselan.formats.jpeg.segments.SOFNSegment;
+import org.apache.commons.sanselan.formats.jpeg.segments.JfifSegment;
+import org.apache.commons.sanselan.formats.jpeg.segments.SofnSegment;
import org.apache.commons.sanselan.formats.jpeg.segments.Segment;
import org.apache.commons.sanselan.formats.jpeg.segments.UnknownSegment;
import org.apache.commons.sanselan.formats.jpeg.xmp.JpegXmpParser;
@@ -163,20 +163,20 @@ public class JpegImageParser extends Ima
result.add(new App2Segment(marker, segmentData));
} else if (marker == JFIFMarker)
{
- result.add(new JFIFSegment(marker, segmentData));
+ result.add(new JfifSegment(marker, segmentData));
} else if (Arrays.binarySearch(sofnSegments, marker) >= 0)
{
- result.add(new SOFNSegment(marker, segmentData));
+ result.add(new SofnSegment(marker, segmentData));
} else if (marker == DQTMarker)
{
- result.add(new DQTSegment(marker, segmentData));
+ result.add(new DqtSegment(marker, segmentData));
} else if ((marker >= JPEG_APP1_Marker)
&& (marker <= JPEG_APP15_Marker))
{
result.add(new UnknownSegment(marker, segmentData));
} else if (marker == COMMarker)
{
- result.add(new COMSegment(marker, segmentData));
+ result.add(new ComSegment(marker, segmentData));
}
if (returnAfterFirst)
@@ -491,7 +491,7 @@ public class JpegImageParser extends Ima
if (marker == JPEG_APP13_Marker)
{
- if (new IPTCParser().isPhotoshopJpegSegment(segmentData))
+ if (new IptcParser().isPhotoshopJpegSegment(segmentData))
{
result[0] = true;
return false;
@@ -655,7 +655,7 @@ public class JpegImageParser extends Ima
if (segments.size() > 1)
throw new ImageReadException("Redundant JFIF Data Found.");
- SOFNSegment fSOFNSegment = (SOFNSegment) segments.get(0);
+ SofnSegment fSOFNSegment = (SofnSegment) segments.get(0);
return new Dimension(fSOFNSegment.width, fSOFNSegment.height);
}
@@ -694,8 +694,8 @@ public class JpegImageParser extends Ima
ArrayList jfifSegments = readSegments(byteSource,
new int[] { JFIFMarker, }, true);
- SOFNSegment fSOFNSegment = (SOFNSegment) SOF_segments.get(0);
- // SOFNSegment fSOFNSegment = (SOFNSegment) findSegment(segments,
+ SofnSegment fSOFNSegment = (SofnSegment) SOF_segments.get(0);
+ // SofnSegment fSOFNSegment = (SofnSegment) findSegment(segments,
// SOFNmarkers);
if (fSOFNSegment == null)
@@ -704,12 +704,12 @@ public class JpegImageParser extends Ima
int Width = fSOFNSegment.width;
int Height = fSOFNSegment.height;
- JFIFSegment jfifSegment = null;
+ JfifSegment jfifSegment = null;
if ((jfifSegments != null) && (jfifSegments.size() > 0))
- jfifSegment = (JFIFSegment) jfifSegments.get(0);
+ jfifSegment = (JfifSegment) jfifSegments.get(0);
- // JFIFSegment fTheJFIFSegment = (JFIFSegment) findSegment(segments,
+ // JfifSegment fTheJFIFSegment = (JfifSegment) findSegment(segments,
// kJFIFMarker);
double x_density = -1.0;
@@ -810,7 +810,7 @@ public class JpegImageParser extends Ima
new int[] { COMMarker }, false);
for (int i = 0; i < commentSegments.size(); i++)
{
- COMSegment comSegment = (COMSegment) commentSegments.get(i);
+ ComSegment comSegment = (ComSegment) commentSegments.get(i);
String comment = "";
try {
comment = new String(comSegment.comment, "ISO-8859-1");
@@ -877,15 +877,15 @@ public class JpegImageParser extends Ima
// jfifMarkers.add(new Integer(JFIFMarker));
// ArrayList jfifSegments = filterSegments(allSegments, jfifMarkers);
//
- // SOFNSegment firstSOFNSegment = (SOFNSegment) SOFSegments.get(0);
+ // SofnSegment firstSOFNSegment = (SofnSegment) SOFSegments.get(0);
//
// int Width = firstSOFNSegment.width;
// int Height = firstSOFNSegment.height;
//
- // JFIFSegment jfifSegment = null;
+ // JfifSegment jfifSegment = null;
//
// if (jfifSegments != null && jfifSegments.size() > 0)
- // jfifSegment = (JFIFSegment) jfifSegments.get(0);
+ // jfifSegment = (JfifSegment) jfifSegments.get(0);
//
// double x_density = -1.0;
// double y_density = -1.0;
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/JpegPhotoshopMetadata.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/JpegPhotoshopMetadata.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/JpegPhotoshopMetadata.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/JpegPhotoshopMetadata.java Mon Dec 19 17:27:28 2011
@@ -20,13 +20,13 @@ import java.util.Collections;
import java.util.List;
import org.apache.commons.sanselan.common.ImageMetadata;
-import org.apache.commons.sanselan.formats.jpeg.iptc.IPTCConstants;
-import org.apache.commons.sanselan.formats.jpeg.iptc.IPTCRecord;
+import org.apache.commons.sanselan.formats.jpeg.iptc.IptcConstants;
+import org.apache.commons.sanselan.formats.jpeg.iptc.IptcRecord;
import org.apache.commons.sanselan.formats.jpeg.iptc.PhotoshopApp13Data;
import org.apache.commons.sanselan.util.Debug;
public class JpegPhotoshopMetadata extends ImageMetadata implements
- IPTCConstants
+ IptcConstants
{
public final PhotoshopApp13Data photoshopApp13Data;
@@ -36,10 +36,10 @@ public class JpegPhotoshopMetadata exten
this.photoshopApp13Data = photoshopApp13Data;
List records = photoshopApp13Data.getRecords();
- Collections.sort(records, IPTCRecord.COMPARATOR);
+ Collections.sort(records, IptcRecord.COMPARATOR);
for (int j = 0; j < records.size(); j++)
{
- IPTCRecord element = (IPTCRecord) records.get(j);
+ IptcRecord element = (IptcRecord) records.get(j);
if (element.iptcType.type != IPTC_TYPE_RECORD_VERSION.type)
add(element.getIptcTypeName(), element.getValue());
}
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/decoder/Dct.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/decoder/DCT.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/decoder/Dct.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/decoder/Dct.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/decoder/DCT.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/decoder/DCT.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/decoder/Dct.java Mon Dec 19 17:27:28 2011
@@ -15,7 +15,7 @@
package org.apache.commons.sanselan.formats.jpeg.decoder;
-public class DCT
+public class Dct
{
/*
* The book "JPEG still image data compression standard",
@@ -135,7 +135,7 @@ public class DCT
}
/**
- * Fast forward DCT using AA&N.
+ * Fast forward Dct using AA&N.
* Taken from the book "JPEG still image data compression standard",
* by Pennebaker and Mitchell, chapter 4, figure "4-8".
*/
@@ -260,7 +260,7 @@ public class DCT
}
/**
- * Fast inverse DCT using AA&N. This is taken from the beautiful
+ * Fast inverse Dct using AA&N. This is taken from the beautiful
* http://vsr.informatik.tu-chemnitz.de/~jan/MPEG/HTML/IDCT.html
* which gives easy equations and properly explains constants and
* scaling factors. Terms have been inlined and the negation
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/decoder/JpegDecoder.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/decoder/JpegDecoder.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/decoder/JpegDecoder.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/decoder/JpegDecoder.java Mon Dec 19 17:27:28 2011
@@ -32,10 +32,10 @@ import org.apache.commons.sanselan.forma
import org.apache.commons.sanselan.formats.jpeg.JpegConstants;
import org.apache.commons.sanselan.formats.jpeg.JpegUtils;
import org.apache.commons.sanselan.formats.jpeg.ZigZag;
-import org.apache.commons.sanselan.formats.jpeg.segments.DHTSegment;
-import org.apache.commons.sanselan.formats.jpeg.segments.DQTSegment;
-import org.apache.commons.sanselan.formats.jpeg.segments.SOFNSegment;
-import org.apache.commons.sanselan.formats.jpeg.segments.SOSSegment;
+import org.apache.commons.sanselan.formats.jpeg.segments.DhtSegment;
+import org.apache.commons.sanselan.formats.jpeg.segments.DqtSegment;
+import org.apache.commons.sanselan.formats.jpeg.segments.SofnSegment;
+import org.apache.commons.sanselan.formats.jpeg.segments.SosSegment;
public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor,
JpegConstants
@@ -53,11 +53,11 @@ public class JpegDecoder extends BinaryF
* for positive numbers.
*/
- private DQTSegment.QuantizationTable[] quantizationTables = new DQTSegment.QuantizationTable[4];
- private DHTSegment.HuffmanTable[] huffmanDCTables = new DHTSegment.HuffmanTable[4];
- private DHTSegment.HuffmanTable[] huffmanACTables = new DHTSegment.HuffmanTable[4];
- private SOFNSegment sofnSegment;
- private SOSSegment sosSegment;
+ private DqtSegment.QuantizationTable[] quantizationTables = new DqtSegment.QuantizationTable[4];
+ private DhtSegment.HuffmanTable[] huffmanDCTables = new DhtSegment.HuffmanTable[4];
+ private DhtSegment.HuffmanTable[] huffmanACTables = new DhtSegment.HuffmanTable[4];
+ private SofnSegment sofnSegment;
+ private SosSegment sosSegment;
private float[][] scaledQuantizationTables = new float[4][];
private BufferedImage image = null;
private ImageReadException imageReadException = null;
@@ -76,9 +76,9 @@ public class JpegDecoder extends BinaryF
{
int segmentLength = read2Bytes("segmentLength", is,
"Not a Valid JPEG File");
- byte[] sosSegmentBytes = readByteArray("SOSSegment",
+ byte[] sosSegmentBytes = readByteArray("SosSegment",
segmentLength - 2, is, "Not a Valid JPEG File");
- sosSegment = new SOSSegment(marker, sosSegmentBytes);
+ sosSegment = new SosSegment(marker, sosSegmentBytes);
int hMax = 0;
int vMax = 0;
@@ -202,14 +202,14 @@ public class JpegDecoder extends BinaryF
if (marker != SOF0Marker)
throw new ImageReadException("Only sequential, baseline JPEGs " +
"are supported at the moment");
- sofnSegment = new SOFNSegment(marker, segmentData);
+ sofnSegment = new SofnSegment(marker, segmentData);
}
else if (marker == DQTMarker)
{
- DQTSegment dqtSegment = new DQTSegment(marker, segmentData);
+ DqtSegment dqtSegment = new DqtSegment(marker, segmentData);
for (int i = 0; i < dqtSegment.quantizationTables.size(); i++)
{
- DQTSegment.QuantizationTable table = (DQTSegment.QuantizationTable)
+ DqtSegment.QuantizationTable table = (DqtSegment.QuantizationTable)
dqtSegment.quantizationTables.get(i);
if (0 > table.destinationIdentifier ||
table.destinationIdentifier >= quantizationTables.length)
@@ -221,19 +221,19 @@ public class JpegDecoder extends BinaryF
float[] quantizationMatrixFloat = new float[64];
for (int j = 0; j < 64; j++)
quantizationMatrixFloat[j] = quantizationMatrixInt[j];
- DCT.scaleDequantizationMatrix(quantizationMatrixFloat);
+ Dct.scaleDequantizationMatrix(quantizationMatrixFloat);
scaledQuantizationTables[table.destinationIdentifier] =
quantizationMatrixFloat;
}
}
else if (marker == DHTMarker)
{
- DHTSegment dhtSegment = new DHTSegment(marker, segmentData);
+ DhtSegment dhtSegment = new DhtSegment(marker, segmentData);
for (int i = 0; i < dhtSegment.huffmanTables.size(); i++)
{
- DHTSegment.HuffmanTable table = (DHTSegment.HuffmanTable)
+ DhtSegment.HuffmanTable table = (DhtSegment.HuffmanTable)
dhtSegment.huffmanTables.get(i);
- DHTSegment.HuffmanTable[] tables;
+ DhtSegment.HuffmanTable[] tables;
if (table.tableClass == 0)
tables = huffmanDCTables;
else if (table.tableClass == 1)
@@ -301,8 +301,8 @@ public class JpegDecoder extends BinaryF
Block[] mcu = new Block[sosSegment.numberOfComponents];
for (int i = 0; i < sosSegment.numberOfComponents; i++)
{
- SOSSegment.Component scanComponent = sosSegment.components[i];
- SOFNSegment.Component frameComponent = null;
+ SosSegment.Component scanComponent = sosSegment.components[i];
+ SofnSegment.Component frameComponent = null;
for (int j = 0; j < sofnSegment.numberOfComponents; j++)
{
if (sofnSegment.components[j].componentIdentifier ==
@@ -330,8 +330,8 @@ public class JpegDecoder extends BinaryF
{
for (int i = 0; i < sosSegment.numberOfComponents; i++)
{
- SOSSegment.Component scanComponent = sosSegment.components[i];
- SOFNSegment.Component frameComponent = null;
+ SosSegment.Component scanComponent = sosSegment.components[i];
+ SofnSegment.Component frameComponent = null;
for (int j = 0; j < sofnSegment.numberOfComponents; j++)
{
if (sofnSegment.components[j].componentIdentifier ==
@@ -397,7 +397,7 @@ public class JpegDecoder extends BinaryF
ZigZag.zigZagToBlock(zz, blockInt);
for (int j = 0; j < 64; j++)
block[j] = blockInt[j] * scaledQuantizationTable[j];
- DCT.inverseDCT8x8(block);
+ Dct.inverseDCT8x8(block);
int dstRowOffset = 8*y*8*frameComponent.horizontalSamplingFactor +
8*x;
@@ -455,7 +455,7 @@ public class JpegDecoder extends BinaryF
return v;
}
- private int decode(JpegInputStream is, DHTSegment.HuffmanTable huffmanTable)
+ private int decode(JpegInputStream is, DhtSegment.HuffmanTable huffmanTable)
throws IOException, ImageReadException
{
// "DECODE", section F.2.2.3, figure F.16, page 109 of T.81
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/exif/ExifRewriter.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/exif/ExifRewriter.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/exif/ExifRewriter.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/exif/ExifRewriter.java Mon Dec 19 17:27:28 2011
@@ -45,7 +45,7 @@ import org.apache.commons.sanselan.util.
* <p>
* See the source of the ExifMetadataUpdateExample class for example usage.
*
- * @see org.apache.commons.sanselan.sampleUsage.WriteExifMetadataExample
+ * @see org.apache.commons.sanselan.examples.WriteExifMetadataExample
*/
public class ExifRewriter extends BinaryFileParser implements JpegConstants
{
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcBlock.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCBlock.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcBlock.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcBlock.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCBlock.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCBlock.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcBlock.java Mon Dec 19 17:27:28 2011
@@ -19,13 +19,13 @@ package org.apache.commons.sanselan.form
/*
* Represents an IPTC block, a set of key-value pairs of Photoshop IPTC data.
*/
-public class IPTCBlock
+public class IptcBlock
{
public final int blockType;
public final byte[] blockNameBytes;
public final byte[] blockData;
- public IPTCBlock(int blockType, byte[] blockNameBytes, byte[] blockData)
+ public IptcBlock(int blockType, byte[] blockNameBytes, byte[] blockData)
{
this.blockData = blockData;
this.blockNameBytes = blockNameBytes;
@@ -34,6 +34,6 @@ public class IPTCBlock
public boolean isIPTCBlock()
{
- return blockType == IPTCParser.IMAGE_RESOURCE_BLOCK_IPTC_DATA;
+ return blockType == IptcParser.IMAGE_RESOURCE_BLOCK_IPTC_DATA;
}
}
\ No newline at end of file
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcConstants.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCConstants.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcConstants.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcConstants.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCConstants.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCConstants.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcConstants.java Mon Dec 19 17:27:28 2011
@@ -18,7 +18,7 @@ package org.apache.commons.sanselan.form
import org.apache.commons.sanselan.formats.jpeg.JpegConstants;
-public interface IPTCConstants extends JpegConstants
+public interface IptcConstants extends JpegConstants
{
public static final byte IPTC_PREFIX[] = { 0x1C, 0x02, };
@@ -95,120 +95,120 @@ public interface IPTCConstants extends J
public static final int IPTC_ENVELOPE_RECORD_NUMBER = 0x01;
public static final int IPTC_APPLICATION_2_RECORD_NUMBER = 0x02;
- public static final IPTCType IPTC_TYPE_RECORD_VERSION = new IPTCType(0,
+ public static final IptcType IPTC_TYPE_RECORD_VERSION = new IptcType(0,
"Record Version");
- public static final IPTCType IPTC_TYPE_OBJECT_TYPE_REFERENCE = new IPTCType(
+ public static final IptcType IPTC_TYPE_OBJECT_TYPE_REFERENCE = new IptcType(
3, "Object Type Reference");
- public static final IPTCType IPTC_TYPE_OBJECT_ATTRIBUTE_REFERENCE = new IPTCType(
+ public static final IptcType IPTC_TYPE_OBJECT_ATTRIBUTE_REFERENCE = new IptcType(
4, "Object Attribute Reference");
- public static final IPTCType IPTC_TYPE_OBJECT_NAME = new IPTCType(5,
+ public static final IptcType IPTC_TYPE_OBJECT_NAME = new IptcType(5,
"Object Name");
- public static final IPTCType IPTC_TYPE_EDIT_STATUS = new IPTCType(7,
+ public static final IptcType IPTC_TYPE_EDIT_STATUS = new IptcType(7,
"Edit Status");
- public static final IPTCType IPTC_TYPE_EDITORIAL_UPDATE = new IPTCType(8,
+ public static final IptcType IPTC_TYPE_EDITORIAL_UPDATE = new IptcType(8,
"Editorial Update");
- public static final IPTCType IPTC_TYPE_URGENCY = new IPTCType(10, "Urgency");
- public static final IPTCType IPTC_TYPE_SUBJECT_REFERENCE = new IPTCType(12,
+ public static final IptcType IPTC_TYPE_URGENCY = new IptcType(10, "Urgency");
+ public static final IptcType IPTC_TYPE_SUBJECT_REFERENCE = new IptcType(12,
"Subject Reference");
- public static final IPTCType IPTC_TYPE_CATEGORY = new IPTCType(15,
+ public static final IptcType IPTC_TYPE_CATEGORY = new IptcType(15,
"Category");
- public static final IPTCType IPTC_TYPE_SUPPLEMENTAL_CATEGORY = new IPTCType(
+ public static final IptcType IPTC_TYPE_SUPPLEMENTAL_CATEGORY = new IptcType(
20, "Supplemental Category");
- public static final IPTCType IPTC_TYPE_FIXTURE_IDENTIFIER = new IPTCType(
+ public static final IptcType IPTC_TYPE_FIXTURE_IDENTIFIER = new IptcType(
22, "Fixture Identifier");
- public static final IPTCType IPTC_TYPE_KEYWORDS = new IPTCType(25,
+ public static final IptcType IPTC_TYPE_KEYWORDS = new IptcType(25,
"Keywords");
- public static final IPTCType IPTC_TYPE_CONTENT_LOCATION_CODE = new IPTCType(
+ public static final IptcType IPTC_TYPE_CONTENT_LOCATION_CODE = new IptcType(
26, "Content Location Code");
- public static final IPTCType IPTC_TYPE_CONTENT_LOCATION_NAME = new IPTCType(
+ public static final IptcType IPTC_TYPE_CONTENT_LOCATION_NAME = new IptcType(
27, "Content Location Name");
- public static final IPTCType IPTC_TYPE_RELEASE_DATE = new IPTCType(30,
+ public static final IptcType IPTC_TYPE_RELEASE_DATE = new IptcType(30,
"Release Date");
- public static final IPTCType IPTC_TYPE_RELEASE_TIME = new IPTCType(35,
+ public static final IptcType IPTC_TYPE_RELEASE_TIME = new IptcType(35,
"Release Time");
- public static final IPTCType IPTC_TYPE_EXPIRATION_DATE = new IPTCType(37,
+ public static final IptcType IPTC_TYPE_EXPIRATION_DATE = new IptcType(37,
"Expiration Date");
- public static final IPTCType IPTC_TYPE_EXPIRATION_TIME = new IPTCType(38,
+ public static final IptcType IPTC_TYPE_EXPIRATION_TIME = new IptcType(38,
"Expiration Time");
- public static final IPTCType IPTC_TYPE_SPECIAL_INSTRUCTIONS = new IPTCType(
+ public static final IptcType IPTC_TYPE_SPECIAL_INSTRUCTIONS = new IptcType(
40, "Special Instructions");
- public static final IPTCType IPTC_TYPE_ACTION_ADVISED = new IPTCType(42,
+ public static final IptcType IPTC_TYPE_ACTION_ADVISED = new IptcType(42,
"Action Advised");
- public static final IPTCType IPTC_TYPE_REFERENCE_SERVICE = new IPTCType(45,
+ public static final IptcType IPTC_TYPE_REFERENCE_SERVICE = new IptcType(45,
"Reference Service");
- public static final IPTCType IPTC_TYPE_REFERENCE_DATE = new IPTCType(47,
+ public static final IptcType IPTC_TYPE_REFERENCE_DATE = new IptcType(47,
"Reference Date");
- public static final IPTCType IPTC_TYPE_REFERENCE_NUMBER = new IPTCType(50,
+ public static final IptcType IPTC_TYPE_REFERENCE_NUMBER = new IptcType(50,
"Reference Number");
- public static final IPTCType IPTC_TYPE_DATE_CREATED = new IPTCType(55,
+ public static final IptcType IPTC_TYPE_DATE_CREATED = new IptcType(55,
"Date Created");
- public static final IPTCType IPTC_TYPE_TIME_CREATED = new IPTCType(60,
+ public static final IptcType IPTC_TYPE_TIME_CREATED = new IptcType(60,
"Time Created");
- public static final IPTCType IPTC_TYPE_DIGITAL_CREATION_DATE = new IPTCType(
+ public static final IptcType IPTC_TYPE_DIGITAL_CREATION_DATE = new IptcType(
62, "Digital Creation Date");
- public static final IPTCType IPTC_TYPE_DIGITAL_CREATION_TIME = new IPTCType(
+ public static final IptcType IPTC_TYPE_DIGITAL_CREATION_TIME = new IptcType(
63, "Digital Creation Time");
- public static final IPTCType IPTC_TYPE_ORIGINATING_PROGRAM = new IPTCType(
+ public static final IptcType IPTC_TYPE_ORIGINATING_PROGRAM = new IptcType(
65, "Originating Program");
- public static final IPTCType IPTC_TYPE_PROGRAM_VERSION = new IPTCType(70,
+ public static final IptcType IPTC_TYPE_PROGRAM_VERSION = new IptcType(70,
"Program Version");
- public static final IPTCType IPTC_TYPE_OBJECT_CYCLE = new IPTCType(75,
+ public static final IptcType IPTC_TYPE_OBJECT_CYCLE = new IptcType(75,
"Object Cycle");
- public static final IPTCType IPTC_TYPE_BYLINE = new IPTCType(80, "By-line");
- public static final IPTCType IPTC_TYPE_BYLINE_TITLE = new IPTCType(85,
+ public static final IptcType IPTC_TYPE_BYLINE = new IptcType(80, "By-line");
+ public static final IptcType IPTC_TYPE_BYLINE_TITLE = new IptcType(85,
"By-line Title");
- public static final IPTCType IPTC_TYPE_CITY = new IPTCType(90, "City");
- public static final IPTCType IPTC_TYPE_SUBLOCATION = new IPTCType(92,
+ public static final IptcType IPTC_TYPE_CITY = new IptcType(90, "City");
+ public static final IptcType IPTC_TYPE_SUBLOCATION = new IptcType(92,
"Sublocation");
- public static final IPTCType IPTC_TYPE_PROVINCE_STATE = new IPTCType(95,
+ public static final IptcType IPTC_TYPE_PROVINCE_STATE = new IptcType(95,
"Province/State");
- public static final IPTCType IPTC_TYPE_COUNTRY_PRIMARY_LOCATION_CODE = new IPTCType(
+ public static final IptcType IPTC_TYPE_COUNTRY_PRIMARY_LOCATION_CODE = new IptcType(
100, "Country/Primary Location Code");
- public static final IPTCType IPTC_TYPE_COUNTRY_PRIMARY_LOCATION_NAME = new IPTCType(
+ public static final IptcType IPTC_TYPE_COUNTRY_PRIMARY_LOCATION_NAME = new IptcType(
101, "Country/Primary Location Name");
- public static final IPTCType IPTC_TYPE_ORIGINAL_TRANSMISSION_REFERENCE = new IPTCType(
+ public static final IptcType IPTC_TYPE_ORIGINAL_TRANSMISSION_REFERENCE = new IptcType(
103, "Original Transmission, Reference");
- public static final IPTCType IPTC_TYPE_HEADLINE = new IPTCType(105,
+ public static final IptcType IPTC_TYPE_HEADLINE = new IptcType(105,
"Headline");
- public static final IPTCType IPTC_TYPE_CREDIT = new IPTCType(110, "Credit");
- public static final IPTCType IPTC_TYPE_SOURCE = new IPTCType(115, "Source");
- public static final IPTCType IPTC_TYPE_COPYRIGHT_NOTICE = new IPTCType(116,
+ public static final IptcType IPTC_TYPE_CREDIT = new IptcType(110, "Credit");
+ public static final IptcType IPTC_TYPE_SOURCE = new IptcType(115, "Source");
+ public static final IptcType IPTC_TYPE_COPYRIGHT_NOTICE = new IptcType(116,
"Copyright Notice");
- public static final IPTCType IPTC_TYPE_CONTACT = new IPTCType(118,
+ public static final IptcType IPTC_TYPE_CONTACT = new IptcType(118,
"Contact");
- public static final IPTCType IPTC_TYPE_CAPTION_ABSTRACT = new IPTCType(120,
+ public static final IptcType IPTC_TYPE_CAPTION_ABSTRACT = new IptcType(120,
"Caption/Abstract");
- public static final IPTCType IPTC_TYPE_WRITER_EDITOR = new IPTCType(122,
+ public static final IptcType IPTC_TYPE_WRITER_EDITOR = new IptcType(122,
"Writer/Editor");
- public static final IPTCType IPTC_TYPE_RASTERIZED_CAPTION = new IPTCType(
+ public static final IptcType IPTC_TYPE_RASTERIZED_CAPTION = new IptcType(
125, "Rasterized Caption");
- public static final IPTCType IPTC_TYPE_IMAGE_TYPE = new IPTCType(130,
+ public static final IptcType IPTC_TYPE_IMAGE_TYPE = new IptcType(130,
"ImageType");
- public static final IPTCType IPTC_TYPE_IMAGE_ORIENTATION = new IPTCType(
+ public static final IptcType IPTC_TYPE_IMAGE_ORIENTATION = new IptcType(
131, "Image Orientation");
- public static final IPTCType IPTC_TYPE_LANGUAGE_IDENTIFIER = new IPTCType(
+ public static final IptcType IPTC_TYPE_LANGUAGE_IDENTIFIER = new IptcType(
135, "Language Identifier");
- public static final IPTCType IPTC_TYPE_AUDIO_TYPE = new IPTCType(150,
+ public static final IptcType IPTC_TYPE_AUDIO_TYPE = new IptcType(150,
"Audio Type");
- public static final IPTCType IPTC_TYPE_AUDIO_SAMPLING_RATE = new IPTCType(
+ public static final IptcType IPTC_TYPE_AUDIO_SAMPLING_RATE = new IptcType(
151, "Audio Sampling Rate");
- public static final IPTCType IPTC_TYPE_AUDIO_SAMPLING_RESOLUTION = new IPTCType(
+ public static final IptcType IPTC_TYPE_AUDIO_SAMPLING_RESOLUTION = new IptcType(
152, "Audio Sampling Resolution");
- public static final IPTCType IPTC_TYPE_AUDIO_DURATION = new IPTCType(153,
+ public static final IptcType IPTC_TYPE_AUDIO_DURATION = new IptcType(153,
"Audio Duration");
- public static final IPTCType IPTC_TYPE_AUDIO_OUTCUE = new IPTCType(154,
+ public static final IptcType IPTC_TYPE_AUDIO_OUTCUE = new IptcType(154,
"Audio Outcue");
- public static final IPTCType IPTC_TYPE_OBJECT_DATA_PREVIEW_FILE_FORMAT = new IPTCType(
+ public static final IptcType IPTC_TYPE_OBJECT_DATA_PREVIEW_FILE_FORMAT = new IptcType(
200, "Object Data Preview, File Format");
- public static final IPTCType IPTC_TYPE_OBJECT_DATA_PREVIEW_FILE_FORMAT_VERSION = new IPTCType(
+ public static final IptcType IPTC_TYPE_OBJECT_DATA_PREVIEW_FILE_FORMAT_VERSION = new IptcType(
201, "Object Data Preview, File Format Version");
- public static final IPTCType IPTC_TYPE_OBJECT_DATA_PREVIEW_DATA = new IPTCType(
+ public static final IptcType IPTC_TYPE_OBJECT_DATA_PREVIEW_DATA = new IptcType(
202, "Object Data Preview Data");
// --
- // public static final IPTCType IPTC_TYPE_UNKNOWN = new IPTCType(-1,
+ // public static final IptcType IPTC_TYPE_UNKNOWN = new IptcType(-1,
// "Unknown");
- public static final IPTCType IPTC_TYPES[] = { IPTC_TYPE_RECORD_VERSION,
+ public static final IptcType IPTC_TYPES[] = { IPTC_TYPE_RECORD_VERSION,
IPTC_TYPE_OBJECT_TYPE_REFERENCE,
IPTC_TYPE_OBJECT_ATTRIBUTE_REFERENCE, IPTC_TYPE_OBJECT_NAME,
IPTC_TYPE_EDIT_STATUS, IPTC_TYPE_EDITORIAL_UPDATE,
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcParser.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCParser.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcParser.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcParser.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCParser.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCParser.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcParser.java Mon Dec 19 17:27:28 2011
@@ -34,11 +34,11 @@ import org.apache.commons.sanselan.commo
import org.apache.commons.sanselan.util.Debug;
import org.apache.commons.sanselan.util.ParamMap;
-public class IPTCParser extends BinaryFileParser implements IPTCConstants
+public class IptcParser extends BinaryFileParser implements IptcConstants
{
private static final int APP13_BYTE_ORDER = BYTE_ORDER_NETWORK;
- public IPTCParser()
+ public IptcParser()
{
setByteOrder(BYTE_ORDER_NETWORK);
}
@@ -82,7 +82,7 @@ public class IPTCParser extends BinaryFi
* structure:
*
* 1. 2-byte prefix. The value is always 0x1C02 2. 1-byte record type. The
- * record types are documented by the IPTC. See IPTCConstants. 3. 2-byte
+ * record types are documented by the IPTC. See IptcConstants. 3. 2-byte
* record size (in bytes). 4. Record data, "record size" bytes long.
*
* Record data (unlike block data) is NOT padded to have an even length.
@@ -117,7 +117,7 @@ public class IPTCParser extends BinaryFi
for (int i = 0; i < allBlocks.size(); i++)
{
- IPTCBlock block = (IPTCBlock) allBlocks.get(i);
+ IptcBlock block = (IptcBlock) allBlocks.get(i);
// Ignore everything but IPTC data.
if (!block.isIPTCBlock())
@@ -236,7 +236,7 @@ public class IPTCParser extends BinaryFi
String value = new String(recordData, "ISO-8859-1");
- IPTCType iptcType = IPTCTypeLookup.getIptcType(recordType);
+ IptcType iptcType = IptcTypeLookup.getIptcType(recordType);
// Debug.debug("iptcType", iptcType);
// debugByteArray("iptcData", iptcData);
@@ -249,7 +249,7 @@ public class IPTCParser extends BinaryFi
// Debug.debug("index", IPTC_TYPE_CREDIT.name);
// }
- IPTCRecord element = new IPTCRecord(iptcType, value);
+ IptcRecord element = new IptcRecord(iptcType, value);
elements.add(element);
}
@@ -333,7 +333,7 @@ public class IPTCParser extends BinaryFi
if (null == blockData)
break;
- blocks.add(new IPTCBlock(blockType, blockNameBytes, blockData));
+ blocks.add(new IptcBlock(blockType, blockNameBytes, blockData));
if ((blockSize % 2) != 0)
bis
@@ -356,7 +356,7 @@ public class IPTCParser extends BinaryFi
List blocks = data.getRawBlocks();
for (int i = 0; i < blocks.size(); i++)
{
- IPTCBlock block = (IPTCBlock) blocks.get(i);
+ IptcBlock block = (IptcBlock) blocks.get(i);
bos.write(CONST_8BIM);
@@ -410,8 +410,8 @@ public class IPTCParser extends BinaryFi
Comparator comparator = new Comparator() {
public int compare(Object o1, Object o2)
{
- IPTCRecord e1 = (IPTCRecord) o1;
- IPTCRecord e2 = (IPTCRecord) o2;
+ IptcRecord e1 = (IptcRecord) o1;
+ IptcRecord e2 = (IptcRecord) o2;
return e2.iptcType.type - e1.iptcType.type;
}
};
@@ -421,7 +421,7 @@ public class IPTCParser extends BinaryFi
// write the list.
for (int i = 0; i < elements.size(); i++)
{
- IPTCRecord element = (IPTCRecord) elements.get(i);
+ IptcRecord element = (IptcRecord) elements.get(i);
if (element.iptcType.type == IPTC_TYPE_RECORD_VERSION.type)
continue; // ignore
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcRecord.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCRecord.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcRecord.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcRecord.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCRecord.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCRecord.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcRecord.java Mon Dec 19 17:27:28 2011
@@ -21,12 +21,12 @@ import java.util.Comparator;
/*
* Represents an IPTC record, a single key-value pair of Photoshop IPTC data.
*/
-public class IPTCRecord
+public class IptcRecord
{
- public final IPTCType iptcType;
+ public final IptcType iptcType;
public final String value;
- public IPTCRecord(IPTCType iptcType, String value)
+ public IptcRecord(IptcType iptcType, String value)
{
this.iptcType = iptcType;
this.value = value;
@@ -45,8 +45,8 @@ public class IPTCRecord
public static final Comparator COMPARATOR = new Comparator() {
public int compare(Object o1, Object o2)
{
- IPTCRecord e1 = (IPTCRecord) o1;
- IPTCRecord e2 = (IPTCRecord) o2;
+ IptcRecord e1 = (IptcRecord) o1;
+ IptcRecord e2 = (IptcRecord) o2;
return e1.iptcType.type - e2.iptcType.type;
}
};
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcType.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCType.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcType.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcType.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCType.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCType.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcType.java Mon Dec 19 17:27:28 2011
@@ -18,12 +18,12 @@ package org.apache.commons.sanselan.form
import org.apache.commons.sanselan.formats.jpeg.JpegConstants;
-public class IPTCType implements JpegConstants, IPTCConstants
+public class IptcType implements JpegConstants, IptcConstants
{
public final int type;
public final String name;
- public IPTCType(int type, String name)
+ public IptcType(int type, String name)
{
this.type = type;
this.name = name;
@@ -34,9 +34,9 @@ public class IPTCType implements JpegCon
return name + " (" + type + ")";
}
- public static IPTCType getUnknown(int type)
+ public static IptcType getUnknown(int type)
{
- return new IPTCType(type, "Unknown");
+ return new IptcType(type, "Unknown");
}
}
\ No newline at end of file
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcTypeLookup.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCTypeLookup.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcTypeLookup.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcTypeLookup.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCTypeLookup.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IPTCTypeLookup.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcTypeLookup.java Mon Dec 19 17:27:28 2011
@@ -19,7 +19,7 @@ package org.apache.commons.sanselan.form
import java.util.HashMap;
import java.util.Map;
-public abstract class IPTCTypeLookup implements IPTCConstants
+public abstract class IptcTypeLookup implements IptcConstants
{
private static final Map IPTC_TYPE_MAP = new HashMap();
@@ -27,17 +27,17 @@ public abstract class IPTCTypeLookup imp
{
for (int i = 0; i < IPTC_TYPES.length; i++)
{
- IPTCType iptcType = IPTC_TYPES[i];
+ IptcType iptcType = IPTC_TYPES[i];
Integer key = new Integer(iptcType.type);
IPTC_TYPE_MAP.put(key, iptcType);
}
}
- public static final IPTCType getIptcType(int type)
+ public static final IptcType getIptcType(int type)
{
Integer key = new Integer(type);
if (!IPTC_TYPE_MAP.containsKey(key))
- return IPTCType.getUnknown(type);
- return (IPTCType) IPTC_TYPE_MAP.get(key);
+ return IptcType.getUnknown(type);
+ return (IptcType) IPTC_TYPE_MAP.get(key);
}
}
\ No newline at end of file
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/JpegIptcRewriter.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/JpegIptcRewriter.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/JpegIptcRewriter.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/JpegIptcRewriter.java Mon Dec 19 17:27:28 2011
@@ -40,9 +40,9 @@ import org.apache.commons.sanselan.forma
* <p>
* See the source of the IPTCUpdateExample class for example usage.
*
- * @see org.apache.commons.sanselan.sampleUsage.WriteIPTCExample
+ * @see org.apache.commons.sanselan.examples.WriteIPTCExample
*/
-public class JpegIptcRewriter extends JpegRewriter implements IPTCConstants
+public class JpegIptcRewriter extends JpegRewriter implements IptcConstants
{
/**
@@ -129,13 +129,13 @@ public class JpegIptcRewriter extends Jp
JFIFPieceSegment oldSegment = (JFIFPieceSegment) photoshopApp13Segments
.get(0);
Map params = new HashMap();
- PhotoshopApp13Data oldData = new IPTCParser()
+ PhotoshopApp13Data oldData = new IptcParser()
.parsePhotoshopSegment(oldSegment.segmentData, params);
List newBlocks = oldData.getNonIptcBlocks();
List newRecords = new ArrayList();
PhotoshopApp13Data newData = new PhotoshopApp13Data(newRecords,
newBlocks);
- byte segmentBytes[] = new IPTCParser()
+ byte segmentBytes[] = new IptcParser()
.writePhotoshopApp13Segment(newData);
JFIFPieceSegment newSegment = new JFIFPieceSegment(
oldSegment.marker, segmentBytes);
@@ -231,18 +231,18 @@ public class JpegIptcRewriter extends Jp
{
// discard old iptc blocks.
List newBlocks = newData.getNonIptcBlocks();
- byte[] newBlockBytes = new IPTCParser().writeIPTCBlock(newData
+ byte[] newBlockBytes = new IptcParser().writeIPTCBlock(newData
.getRecords());
int blockType = IMAGE_RESOURCE_BLOCK_IPTC_DATA;
byte[] blockNameBytes = new byte[0];
- IPTCBlock newBlock = new IPTCBlock(blockType, blockNameBytes,
+ IptcBlock newBlock = new IptcBlock(blockType, blockNameBytes,
newBlockBytes);
newBlocks.add(newBlock);
newData = new PhotoshopApp13Data(newData.getRecords(), newBlocks);
- byte segmentBytes[] = new IPTCParser()
+ byte segmentBytes[] = new IptcParser()
.writePhotoshopApp13Segment(newData);
JFIFPieceSegment newSegment = new JFIFPieceSegment(
JPEG_APP13_Marker, segmentBytes);
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/PhotoshopApp13Data.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/PhotoshopApp13Data.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/PhotoshopApp13Data.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/PhotoshopApp13Data.java Mon Dec 19 17:27:28 2011
@@ -20,7 +20,7 @@ package org.apache.commons.sanselan.form
import java.util.ArrayList;
import java.util.List;
-public class PhotoshopApp13Data implements IPTCConstants
+public class PhotoshopApp13Data implements IptcConstants
{
private final List records;
private final List rawBlocks;
@@ -46,7 +46,7 @@ public class PhotoshopApp13Data implemen
List result = new ArrayList();
for (int i = 0; i < rawBlocks.size(); i++)
{
- IPTCBlock block = (IPTCBlock) rawBlocks.get(i);
+ IptcBlock block = (IptcBlock) rawBlocks.get(i);
if (!block.isIPTCBlock())
result.add(block);
}
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/App13Segment.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/App13Segment.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/App13Segment.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/App13Segment.java Mon Dec 19 17:27:28 2011
@@ -23,10 +23,10 @@ import java.util.Map;
import org.apache.commons.sanselan.ImageReadException;
import org.apache.commons.sanselan.formats.jpeg.JpegImageParser;
-import org.apache.commons.sanselan.formats.jpeg.iptc.IPTCParser;
+import org.apache.commons.sanselan.formats.jpeg.iptc.IptcParser;
import org.apache.commons.sanselan.formats.jpeg.iptc.PhotoshopApp13Data;
-public class App13Segment extends APPNSegment
+public class App13Segment extends AppnSegment
{
protected final JpegImageParser parser;
@@ -46,7 +46,7 @@ public class App13Segment extends APPNSe
super(marker, marker_length, is);
this.parser = parser;
- // isIPTCJpegSegment = new IPTCParser().isIPTCJpegSegment(bytes);
+ // isIPTCJpegSegment = new IptcParser().isIPTCJpegSegment(bytes);
// if (isIPTCJpegSegment)
// {
// /*
@@ -56,14 +56,14 @@ public class App13Segment extends APPNSe
// */
// boolean verbose = false;
// boolean strict = false;
- // elements.addAll(new IPTCParser().parseIPTCJPEGSegment(bytes,
+ // elements.addAll(new IptcParser().parseIPTCJPEGSegment(bytes,
// verbose, strict));
// }
}
public boolean isPhotoshopJpegSegment() throws ImageReadException, IOException
{
- return new IPTCParser().isPhotoshopJpegSegment(bytes);
+ return new IptcParser().isPhotoshopJpegSegment(bytes);
}
public PhotoshopApp13Data parsePhotoshopSegment(Map params)
@@ -74,9 +74,9 @@ public class App13Segment extends APPNSe
* metadata. However, we should not treat App13 signatures without
* Photoshop's signature as Photoshop/IPTC segments.
*/
- if (!new IPTCParser().isPhotoshopJpegSegment(bytes))
+ if (!new IptcParser().isPhotoshopJpegSegment(bytes))
return null;
- return new IPTCParser().parsePhotoshopSegment(bytes, params);
+ return new IptcParser().parsePhotoshopSegment(bytes, params);
}
}
\ No newline at end of file
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/App2Segment.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/App2Segment.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/App2Segment.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/App2Segment.java Mon Dec 19 17:27:28 2011
@@ -23,7 +23,7 @@ import java.io.InputStream;
import org.apache.commons.sanselan.ImageReadException;
import org.apache.commons.sanselan.formats.jpeg.JpegImageParser;
-public class App2Segment extends APPNSegment implements Comparable
+public class App2Segment extends AppnSegment implements Comparable
{
public final byte icc_bytes[];
public final int cur_marker, num_markers;
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/AppnSegment.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/APPNSegment.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/AppnSegment.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/AppnSegment.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/APPNSegment.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/APPNSegment.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/AppnSegment.java Mon Dec 19 17:27:28 2011
@@ -22,9 +22,9 @@ import java.io.InputStream;
import org.apache.commons.sanselan.ImageReadException;
import org.apache.commons.sanselan.formats.jpeg.JpegImageParser;
-public class APPNSegment extends GenericSegment
+public class AppnSegment extends GenericSegment
{
- public APPNSegment(int marker, int marker_length, InputStream is)
+ public AppnSegment(int marker, int marker_length, InputStream is)
throws ImageReadException, IOException
{
super(marker, marker_length, is);
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/ComSegment.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/COMSegment.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/ComSegment.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/ComSegment.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/COMSegment.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/COMSegment.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/ComSegment.java Mon Dec 19 17:27:28 2011
@@ -23,23 +23,23 @@ import java.io.UnsupportedEncodingExcept
import org.apache.commons.sanselan.ImageReadException;
-public class COMSegment extends Segment
+public class ComSegment extends Segment
{
public final byte[] comment;
- public COMSegment(int marker, byte segmentData[])
+ public ComSegment(int marker, byte segmentData[])
throws ImageReadException, IOException
{
this(marker, segmentData.length, new ByteArrayInputStream(segmentData));
}
- public COMSegment(int marker, int marker_length, InputStream is)
+ public ComSegment(int marker, int marker_length, InputStream is)
throws ImageReadException, IOException
{
super(marker, marker_length);
if (getDebug())
- System.out.println("COMSegment marker_length: " + marker_length);
+ System.out.println("ComSegment marker_length: " + marker_length);
comment = readByteArray("Comment", marker_length, is, "Error reading JPEG comment");
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DhtSegment.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DHTSegment.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DhtSegment.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DhtSegment.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DHTSegment.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DHTSegment.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DhtSegment.java Mon Dec 19 17:27:28 2011
@@ -22,7 +22,7 @@ import java.util.ArrayList;
import org.apache.commons.sanselan.ImageReadException;
-public class DHTSegment extends Segment
+public class DhtSegment extends Segment
{
public final ArrayList huffmanTables = new ArrayList();
@@ -122,13 +122,13 @@ public class DHTSegment extends Segment
}
- public DHTSegment(int marker, byte[] segmentData)
+ public DhtSegment(int marker, byte[] segmentData)
throws ImageReadException, IOException
{
this(marker, segmentData.length, new ByteArrayInputStream(segmentData));
}
- public DHTSegment(int marker, int length, InputStream is)
+ public DhtSegment(int marker, int length, InputStream is)
throws ImageReadException, IOException
{
super(marker, length);
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DqtSegment.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DQTSegment.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DqtSegment.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DqtSegment.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DQTSegment.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DQTSegment.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/DqtSegment.java Mon Dec 19 17:27:28 2011
@@ -22,7 +22,7 @@ import java.util.ArrayList;
import org.apache.commons.sanselan.ImageReadException;
-public class DQTSegment extends Segment
+public class DqtSegment extends Segment
{
public final ArrayList quantizationTables = new ArrayList();
@@ -41,13 +41,13 @@ public class DQTSegment extends Segment
}
}
- public DQTSegment(int marker, byte[] segmentData)
+ public DqtSegment(int marker, byte[] segmentData)
throws ImageReadException, IOException
{
this(marker, segmentData.length, new ByteArrayInputStream(segmentData));
}
- public DQTSegment(int marker, int length, InputStream is)
+ public DqtSegment(int marker, int length, InputStream is)
throws ImageReadException, IOException
{
super(marker, length);
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/JfifSegment.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/JFIFSegment.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/JfifSegment.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/JfifSegment.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/JFIFSegment.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/JFIFSegment.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/JfifSegment.java Mon Dec 19 17:27:28 2011
@@ -23,7 +23,7 @@ import java.io.InputStream;
import org.apache.commons.sanselan.ImageReadException;
import org.apache.commons.sanselan.formats.jpeg.JpegConstants;
-public class JFIFSegment extends Segment implements JpegConstants
+public class JfifSegment extends Segment implements JpegConstants
{
public final int jfifMajorVersion;
public final int jfifMinorVersion;
@@ -40,13 +40,13 @@ public class JFIFSegment extends Segment
return "JFIF (" + getSegmentType() + ")";
}
- public JFIFSegment(int marker, byte segmentData[])
+ public JfifSegment(int marker, byte segmentData[])
throws ImageReadException, IOException
{
this(marker, segmentData.length, new ByteArrayInputStream(segmentData));
}
- public JFIFSegment(int marker, int marker_length, InputStream is)
+ public JfifSegment(int marker, int marker_length, InputStream is)
throws ImageReadException, IOException
{
super(marker, marker_length);
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/Segment.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/Segment.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/Segment.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/Segment.java Mon Dec 19 17:27:28 2011
@@ -50,34 +50,34 @@ public abstract class Segment extends Bi
switch (marker)
{
case 0xffc0 :
- return "Start Of Frame, Baseline DCT, Huffman coding";
+ return "Start Of Frame, Baseline Dct, Huffman coding";
case 0xffc1 :
- return "Start Of Frame, Extended sequential DCT, Huffman coding";
+ return "Start Of Frame, Extended sequential Dct, Huffman coding";
case 0xffc2 :
- return "Start Of Frame, Progressive DCT, Huffman coding";
+ return "Start Of Frame, Progressive Dct, Huffman coding";
case 0xffc3 :
return "Start Of Frame, Lossless (sequential), Huffman coding";
case 0xffc5 :
- return "Start Of Frame, Differential sequential DCT, Huffman coding";
+ return "Start Of Frame, Differential sequential Dct, Huffman coding";
case 0xffc6 :
- return "Start Of Frame, Differential progressive DCT, Huffman coding";
+ return "Start Of Frame, Differential progressive Dct, Huffman coding";
case 0xffc7 :
return "Start Of Frame, Differential lossless (sequential), Huffman coding";
case 0xffc8 :
return "Start Of Frame, Reserved for JPEG extensions, arithmetic coding";
case 0xffc9 :
- return "Start Of Frame, Extended sequential DCT, arithmetic coding";
+ return "Start Of Frame, Extended sequential Dct, arithmetic coding";
case 0xffca :
- return "Start Of Frame, Progressive DCT, arithmetic coding";
+ return "Start Of Frame, Progressive Dct, arithmetic coding";
case 0xffcb :
return "Start Of Frame, Lossless (sequential), arithmetic coding";
case 0xffcd :
- return "Start Of Frame, Differential sequential DCT, arithmetic coding";
+ return "Start Of Frame, Differential sequential Dct, arithmetic coding";
case 0xffce :
- return "Start Of Frame, Differential progressive DCT, arithmetic coding";
+ return "Start Of Frame, Differential progressive Dct, arithmetic coding";
case 0xffcf :
return "Start Of Frame, Differential lossless (sequential), arithmetic coding";
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SofnSegment.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SOFNSegment.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SofnSegment.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SofnSegment.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SOFNSegment.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SOFNSegment.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SofnSegment.java Mon Dec 19 17:27:28 2011
@@ -23,7 +23,7 @@ import java.io.InputStream;
import org.apache.commons.sanselan.ImageReadException;
import org.apache.commons.sanselan.formats.jpeg.JpegImageParser;
-public class SOFNSegment extends Segment
+public class SofnSegment extends Segment
{
public final int width, height;
public final int numberOfComponents;
@@ -49,13 +49,13 @@ public class SOFNSegment extends Segment
}
}
- public SOFNSegment(int marker, byte segmentData[])
+ public SofnSegment(int marker, byte segmentData[])
throws ImageReadException, IOException
{
this(marker, segmentData.length, new ByteArrayInputStream(segmentData));
}
- public SOFNSegment(int marker, int marker_length, InputStream is)
+ public SofnSegment(int marker, int marker_length, InputStream is)
throws ImageReadException, IOException
{
super(marker, marker_length);
Copied: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SosSegment.java (from r1220584, commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SOSSegment.java)
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SosSegment.java?p2=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SosSegment.java&p1=commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SOSSegment.java&r1=1220584&r2=1220868&rev=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SOSSegment.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/segments/SosSegment.java Mon Dec 19 17:27:28 2011
@@ -22,7 +22,7 @@ import java.io.InputStream;
import org.apache.commons.sanselan.ImageReadException;
-public class SOSSegment extends Segment
+public class SosSegment extends Segment
{
public final int numberOfComponents;
public final Component[] components;
@@ -47,19 +47,19 @@ public class SOSSegment extends Segment
}
}
- public SOSSegment(int marker, byte[] segmentData)
+ public SosSegment(int marker, byte[] segmentData)
throws ImageReadException, IOException
{
this(marker, segmentData.length, new ByteArrayInputStream(segmentData));
}
- public SOSSegment(int marker, int marker_length, InputStream is)
+ public SosSegment(int marker, int marker_length, InputStream is)
throws ImageReadException, IOException
{
super(marker, marker_length);
if (getDebug())
- System.out.println("SOSSegment marker_length: " + marker_length);
+ System.out.println("SosSegment marker_length: " + marker_length);
// Debug.debug("SOS", marker_length);
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/xmp/JpegRewriter.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/xmp/JpegRewriter.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/xmp/JpegRewriter.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/xmp/JpegRewriter.java Mon Dec 19 17:27:28 2011
@@ -27,7 +27,7 @@ import org.apache.commons.sanselan.commo
import org.apache.commons.sanselan.common.bytesource.ByteSource;
import org.apache.commons.sanselan.formats.jpeg.JpegConstants;
import org.apache.commons.sanselan.formats.jpeg.JpegUtils;
-import org.apache.commons.sanselan.formats.jpeg.iptc.IPTCParser;
+import org.apache.commons.sanselan.formats.jpeg.iptc.IptcParser;
/**
* Interface for Exif write/update/remove functionality for Jpeg/JFIF images.
@@ -35,7 +35,7 @@ import org.apache.commons.sanselan.forma
* <p>
* See the source of the XmpXmlUpdateExample class for example usage.
*
- * @see org.apache.commons.sanselan.sampleUsage.WriteXmpXmlExample
+ * @see org.apache.commons.sanselan.examples.WriteXmpXmlExample
*/
public class JpegRewriter extends BinaryFileParser implements JpegConstants
{
@@ -131,7 +131,7 @@ public class JpegRewriter extends Binary
{
if (marker != JPEG_APP13_Marker)
return false;
- if (!new IPTCParser().isPhotoshopJpegSegment(segmentData))
+ if (!new IptcParser().isPhotoshopJpegSegment(segmentData))
return false;
return true;
}
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/xmp/JpegXmpRewriter.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/xmp/JpegXmpRewriter.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/xmp/JpegXmpRewriter.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/xmp/JpegXmpRewriter.java Mon Dec 19 17:27:28 2011
@@ -37,7 +37,7 @@ import org.apache.commons.sanselan.commo
* <p>
* See the source of the XmpXmlUpdateExample class for example usage.
*
- * @see org.apache.commons.sanselan.sampleUsage.WriteXmpXmlExample
+ * @see org.apache.commons.sanselan.examples.WriteXmpXmlExample
*/
public class JpegXmpRewriter extends JpegRewriter
{
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngImageParser.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngImageParser.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngImageParser.java Mon Dec 19 17:27:28 2011
@@ -43,17 +43,17 @@ import org.apache.commons.sanselan.Image
import org.apache.commons.sanselan.common.IImageMetadata;
import org.apache.commons.sanselan.common.ImageMetadata;
import org.apache.commons.sanselan.common.bytesource.ByteSource;
-import org.apache.commons.sanselan.formats.png.chunks.PNGChunk;
-import org.apache.commons.sanselan.formats.png.chunks.PNGChunkIDAT;
-import org.apache.commons.sanselan.formats.png.chunks.PNGChunkIHDR;
-import org.apache.commons.sanselan.formats.png.chunks.PNGChunkPLTE;
-import org.apache.commons.sanselan.formats.png.chunks.PNGChunkgAMA;
-import org.apache.commons.sanselan.formats.png.chunks.PNGChunkiCCP;
-import org.apache.commons.sanselan.formats.png.chunks.PNGChunkiTXt;
-import org.apache.commons.sanselan.formats.png.chunks.PNGChunkpHYs;
-import org.apache.commons.sanselan.formats.png.chunks.PNGChunktEXt;
-import org.apache.commons.sanselan.formats.png.chunks.PNGChunkzTXt;
-import org.apache.commons.sanselan.formats.png.chunks.PNGTextChunk;
+import org.apache.commons.sanselan.formats.png.chunks.PngChunk;
+import org.apache.commons.sanselan.formats.png.chunks.PngChunkIdat;
+import org.apache.commons.sanselan.formats.png.chunks.PngChunkIhdr;
+import org.apache.commons.sanselan.formats.png.chunks.PngChunkPlte;
+import org.apache.commons.sanselan.formats.png.chunks.PngChunkGama;
+import org.apache.commons.sanselan.formats.png.chunks.PngChunkIccp;
+import org.apache.commons.sanselan.formats.png.chunks.PngChunkItxt;
+import org.apache.commons.sanselan.formats.png.chunks.PngChunkPhys;
+import org.apache.commons.sanselan.formats.png.chunks.PngChunkText;
+import org.apache.commons.sanselan.formats.png.chunks.PngChunkZtxt;
+import org.apache.commons.sanselan.formats.png.chunks.PngTextChunk;
import org.apache.commons.sanselan.formats.transparencyfilters.TransparencyFilter;
import org.apache.commons.sanselan.formats.transparencyfilters.TransparencyFilterGrayscale;
import org.apache.commons.sanselan.formats.transparencyfilters.TransparencyFilterIndexedColor;
@@ -113,7 +113,7 @@ public class PngImageParser extends Imag
List chunks = readChunks(is, null, false);
List chunkTypes = new ArrayList();
for (int i=0; i<chunks.size(); i++) {
- PNGChunk chunk = (PNGChunk) chunks.get(i);
+ PngChunk chunk = (PngChunk) chunks.get(i);
chunkTypes.add(getChunkTypeName(chunk.chunkType));
}
return chunkTypes;
@@ -198,25 +198,25 @@ public class PngImageParser extends Imag
if (keep)
{
if (chunkType == iCCP)
- result.add(new PNGChunkiCCP(length, chunkType, CRC, bytes));
+ result.add(new PngChunkIccp(length, chunkType, CRC, bytes));
else if (chunkType == tEXt)
- result.add(new PNGChunktEXt(length, chunkType, CRC, bytes));
+ result.add(new PngChunkText(length, chunkType, CRC, bytes));
else if (chunkType == zTXt)
- result.add(new PNGChunkzTXt(length, chunkType, CRC, bytes));
+ result.add(new PngChunkZtxt(length, chunkType, CRC, bytes));
else if (chunkType == IHDR)
- result.add(new PNGChunkIHDR(length, chunkType, CRC, bytes));
+ result.add(new PngChunkIhdr(length, chunkType, CRC, bytes));
else if (chunkType == PLTE)
- result.add(new PNGChunkPLTE(length, chunkType, CRC, bytes));
+ result.add(new PngChunkPlte(length, chunkType, CRC, bytes));
else if (chunkType == pHYs)
- result.add(new PNGChunkpHYs(length, chunkType, CRC, bytes));
+ result.add(new PngChunkPhys(length, chunkType, CRC, bytes));
else if (chunkType == IDAT)
- result.add(new PNGChunkIDAT(length, chunkType, CRC, bytes));
+ result.add(new PngChunkIdat(length, chunkType, CRC, bytes));
else if (chunkType == gAMA)
- result.add(new PNGChunkgAMA(length, chunkType, CRC, bytes));
+ result.add(new PngChunkGama(length, chunkType, CRC, bytes));
else if (chunkType == iTXt)
- result.add(new PNGChunkiTXt(length, chunkType, CRC, bytes));
+ result.add(new PngChunkItxt(length, chunkType, CRC, bytes));
else
- result.add(new PNGChunk(length, chunkType, CRC, bytes));
+ result.add(new PngChunk(length, chunkType, CRC, bytes));
if (returnAfterFirst)
return result;
@@ -282,7 +282,7 @@ public class PngImageParser extends Imag
throw new ImageReadException(
"PNG contains more than one ICC Profile ");
- PNGChunkiCCP pngChunkiCCP = (PNGChunkiCCP) chunks.get(0);
+ PngChunkIccp pngChunkiCCP = (PngChunkIccp) chunks.get(0);
byte bytes[] = pngChunkiCCP.UncompressedProfile;
return (bytes);
@@ -299,7 +299,7 @@ public class PngImageParser extends Imag
if (chunks.size() > 1)
throw new ImageReadException("PNG contains more than one Header");
- PNGChunkIHDR pngChunkIHDR = (PNGChunkIHDR) chunks.get(0);
+ PngChunkIhdr pngChunkIHDR = (PngChunkIhdr) chunks.get(0);
return new Dimension(pngChunkIHDR.width, pngChunkIHDR.height);
}
@@ -327,7 +327,7 @@ public class PngImageParser extends Imag
for (int i = 0; i < chunks.size(); i++)
{
- PNGTextChunk chunk = (PNGTextChunk) chunks.get(i);
+ PngTextChunk chunk = (PngTextChunk) chunks.get(i);
result.add(chunk.getKeyword(), chunk.getText());
}
@@ -437,7 +437,7 @@ public class PngImageParser extends Imag
for (int i = 0; i < v.size(); i++)
{
- PNGChunk chunk = (PNGChunk) v.get(i);
+ PngChunk chunk = (PngChunk) v.get(i);
if (chunk.chunkType == type)
result.add(chunk);
}
@@ -496,7 +496,7 @@ public class PngImageParser extends Imag
// I may not have always preserved byte order correctly.
private TransparencyFilter getTransparencyFilter(int ColorType,
- PNGChunk pngChunktRNS) throws ImageReadException, IOException
+ PngChunk pngChunktRNS) throws ImageReadException, IOException
{
// this.printCharQuad("pngChunktRNS.ChunkType", pngChunktRNS.ChunkType);
// this.debugNumber("pngChunktRNS.Length", pngChunktRNS.Length);
@@ -537,8 +537,8 @@ public class PngImageParser extends Imag
if (IHDRs.size() != 1)
throw new ImageReadException("PNG contains more than one Header");
- PNGChunkIHDR pngChunkIHDR = (PNGChunkIHDR) IHDRs.get(0);
- PNGChunk pngChunktRNS = null;
+ PngChunkIhdr pngChunkIHDR = (PngChunkIhdr) IHDRs.get(0);
+ PngChunk pngChunktRNS = null;
boolean isTransparent = false;
@@ -546,21 +546,21 @@ public class PngImageParser extends Imag
if (tRNSs.size() > 0)
{
isTransparent = true;
- pngChunktRNS = (PNGChunk) IHDRs.get(0);
+ pngChunktRNS = (PngChunk) IHDRs.get(0);
} else {
// CE - Fix Alpha.
isTransparent = hasAlphaChannel(pngChunkIHDR.colorType);
// END FIX
}
- PNGChunkpHYs pngChunkpHYs = null;
+ PngChunkPhys pngChunkpHYs = null;
ArrayList pHYss = filterChunks(chunks, pHYs);
if (pHYss.size() > 1)
throw new ImageReadException("PNG contains more than one pHYs: "
+ pHYss.size());
else if (pHYss.size() == 1)
- pngChunkpHYs = (PNGChunkpHYs) pHYss.get(0);
+ pngChunkpHYs = (PngChunkPhys) pHYss.get(0);
ArrayList tEXts = filterChunks(chunks, tEXt);
ArrayList zTXts = filterChunks(chunks, zTXt);
@@ -572,19 +572,19 @@ public class PngImageParser extends Imag
for (int i = 0; i < tEXts.size(); i++)
{
- PNGChunktEXt pngChunktEXt = (PNGChunktEXt) tEXts.get(i);
+ PngChunkText pngChunktEXt = (PngChunkText) tEXts.get(i);
comments.add(pngChunktEXt.keyword + ": " + pngChunktEXt.text);
textChunks.add(pngChunktEXt.getContents());
}
for (int i = 0; i < zTXts.size(); i++)
{
- PNGChunkzTXt pngChunkzTXt = (PNGChunkzTXt) zTXts.get(i);
+ PngChunkZtxt pngChunkzTXt = (PngChunkZtxt) zTXts.get(i);
comments.add(pngChunkzTXt.keyword + ": " + pngChunkzTXt.text);
textChunks.add(pngChunkzTXt.getContents());
}
for (int i = 0; i < iTXts.size(); i++)
{
- PNGChunkiTXt pngChunkiTXt = (PNGChunkiTXt) iTXts.get(i);
+ PngChunkItxt pngChunkiTXt = (PngChunkItxt) iTXts.get(i);
comments.add(pngChunkiTXt.keyword + ": " + pngChunkiTXt.text);
textChunks.add(pngChunkiTXt.getContents());
}
@@ -697,15 +697,15 @@ public class PngImageParser extends Imag
if (IHDRs.size() != 1)
throw new ImageReadException("PNG contains more than one Header");
- PNGChunkIHDR pngChunkIHDR = (PNGChunkIHDR) IHDRs.get(0);
+ PngChunkIhdr pngChunkIHDR = (PngChunkIhdr) IHDRs.get(0);
ArrayList PLTEs = filterChunks(chunks, PLTE);
if (PLTEs.size() > 1)
throw new ImageReadException("PNG contains more than one Palette");
- PNGChunkPLTE pngChunkPLTE = null;
+ PngChunkPlte pngChunkPLTE = null;
if (PLTEs.size() == 1)
- pngChunkPLTE = (PNGChunkPLTE) PLTEs.get(0);
+ pngChunkPLTE = (PngChunkPlte) PLTEs.get(0);
// -----
@@ -716,7 +716,7 @@ public class PngImageParser extends Imag
ByteArrayOutputStream baos = new ByteArrayOutputStream();
for (int i = 0; i < IDATs.size(); i++)
{
- PNGChunkIDAT pngChunkIDAT = (PNGChunkIDAT) IDATs.get(i);
+ PngChunkIdat pngChunkIDAT = (PngChunkIdat) IDATs.get(i);
byte bytes[] = pngChunkIDAT.bytes;
// System.out.println(i + ": bytes: " + bytes.length);
baos.write(bytes);
@@ -731,7 +731,7 @@ public class PngImageParser extends Imag
ArrayList tRNSs = filterChunks(chunks, tRNS);
if (tRNSs.size() > 0)
{
- PNGChunk pngChunktRNS = (PNGChunk) tRNSs.get(0);
+ PngChunk pngChunktRNS = (PngChunk) tRNSs.get(0);
transparencyFilter = getTransparencyFilter(pngChunkIHDR.colorType,
pngChunktRNS);
}
@@ -759,13 +759,13 @@ public class PngImageParser extends Imag
if (debug)
System.out.println("iCCP.");
- PNGChunkiCCP pngChunkiCCP = (PNGChunkiCCP) iCCPs.get(0);
+ PngChunkIccp pngChunkiCCP = (PngChunkIccp) iCCPs.get(0);
byte bytes[] = pngChunkiCCP.UncompressedProfile;
icc_profile = ICC_Profile.getInstance(bytes);
} else if (gAMAs.size() == 1)
{
- PNGChunkgAMA pngChunkgAMA = (PNGChunkgAMA) gAMAs.get(0);
+ PngChunkGama pngChunkgAMA = (PngChunkGama) gAMAs.get(0);
double gamma = pngChunkgAMA.getGamma();
// charles: what is the correct target value here?
@@ -869,7 +869,7 @@ public class PngImageParser extends Imag
System.out.println("PNG contains more than one Header");
return false;
}
- PNGChunkIHDR pngChunkIHDR = (PNGChunkIHDR) IHDRs.get(0);
+ PngChunkIhdr pngChunkIHDR = (PngChunkIhdr) IHDRs.get(0);
pw.println("Color: "
+ getColorTypeDescription(pngChunkIHDR.colorType));
}
@@ -881,7 +881,7 @@ public class PngImageParser extends Imag
for (int i = 0; i < chunks.size(); i++)
{
- PNGChunk chunk = (PNGChunk) chunks.get(i);
+ PngChunk chunk = (PngChunk) chunks.get(i);
printCharQuad(pw, "\t" + i + ": ", chunk.chunkType);
}
}
@@ -921,7 +921,7 @@ public class PngImageParser extends Imag
List xmpChunks = new ArrayList();
for (int i = 0; i < chunks.size(); i++)
{
- PNGChunkiTXt chunk = (PNGChunkiTXt) chunks.get(i);
+ PngChunkItxt chunk = (PngChunkItxt) chunks.get(i);
if (!chunk.getKeyword().equals(XMP_KEYWORD))
continue;
xmpChunks.add(chunk);
@@ -933,7 +933,7 @@ public class PngImageParser extends Imag
throw new ImageReadException(
"PNG contains more than one XMP chunk.");
- PNGChunkiTXt chunk = (PNGChunkiTXt) xmpChunks.get(0);
+ PngChunkItxt chunk = (PngChunkItxt) xmpChunks.get(0);
return chunk.getText();
}
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/ScanExpediter.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/ScanExpediter.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/ScanExpediter.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/ScanExpediter.java Mon Dec 19 17:27:28 2011
@@ -22,7 +22,7 @@ import java.io.InputStream;
import org.apache.commons.sanselan.ImageReadException;
import org.apache.commons.sanselan.common.BinaryFileParser;
-import org.apache.commons.sanselan.formats.png.chunks.PNGChunkPLTE;
+import org.apache.commons.sanselan.formats.png.chunks.PngChunkPlte;
import org.apache.commons.sanselan.formats.png.scanlinefilters.ScanlineFilter;
import org.apache.commons.sanselan.formats.png.scanlinefilters.ScanlineFilterAverage;
import org.apache.commons.sanselan.formats.png.scanlinefilters.ScanlineFilterNone;
@@ -41,13 +41,13 @@ public abstract class ScanExpediter exte
protected final int bitDepth;
protected final int bytesPerPixel;
protected final int bitsPerPixel;
- protected final PNGChunkPLTE pngChunkPLTE;
+ protected final PngChunkPlte pngChunkPLTE;
protected final GammaCorrection gammaCorrection;
protected final TransparencyFilter transparencyFilter;
public ScanExpediter(int width, int height, InputStream is,
BufferedImage bi, int color_type, int bitDepth, int bitsPerPixel,
- PNGChunkPLTE pngChunkPLTE, GammaCorrection gammaCorrection,
+ PngChunkPlte pngChunkPLTE, GammaCorrection gammaCorrection,
TransparencyFilter transparencyFilter)
{
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/ScanExpediterInterlaced.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/ScanExpediterInterlaced.java?rev=1220868&r1=1220867&r2=1220868&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/ScanExpediterInterlaced.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/ScanExpediterInterlaced.java Mon Dec 19 17:27:28 2011
@@ -21,14 +21,14 @@ import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.sanselan.ImageReadException;
-import org.apache.commons.sanselan.formats.png.chunks.PNGChunkPLTE;
+import org.apache.commons.sanselan.formats.png.chunks.PngChunkPlte;
import org.apache.commons.sanselan.formats.transparencyfilters.TransparencyFilter;
public class ScanExpediterInterlaced extends ScanExpediter
{
public ScanExpediterInterlaced(int width, int height, InputStream is,
BufferedImage bi, int color_type, int BitDepth, int bits_per_pixel,
- PNGChunkPLTE fPNGChunkPLTE, GammaCorrection fGammaCorrection,
+ PngChunkPlte fPNGChunkPLTE, GammaCorrection fGammaCorrection,
TransparencyFilter fTransparencyFilter)
{
@@ -38,7 +38,7 @@ public class ScanExpediterInterlaced ext
private void visit(int x, int y, BufferedImage bi, BitParser fBitParser,
int color_type, int pixel_index_in_scanline,
- PNGChunkPLTE fPNGChunkPLTE, GammaCorrection fGammaCorrection)
+ PngChunkPlte fPNGChunkPLTE, GammaCorrection fGammaCorrection)
throws ImageReadException, IOException
{
int rgb = getRGB(fBitParser,