commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1241084 - in /commons/proper/sanselan/trunk/src: main/java/org/apache/commons/sanselan/formats/jpeg/ main/java/org/apache/commons/sanselan/formats/tiff/ main/java/org/apache/commons/sanselan/formats/tiff/constants/ main/java/org/apache/com...
Date Mon, 06 Feb 2012 17:19:47 GMT
Author: damjan
Date: Mon Feb  6 17:19:47 2012
New Revision: 1241084

URL: http://svn.apache.org/viewvc?rev=1241084&view=rev
Log:
Convert TiffTagConstants to an enum.


Modified:
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/JpegImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffDirectory.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffField.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffReader.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/AllTagConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffTagConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/datareaders/DataReader.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffImageWriterBase.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffOutputDirectory.java
    commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/MetadataExample.java
    commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/WriteTagsTest.java

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=1241084&r1=1241083&r2=1241084&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 Feb  6 17:19:47 2012
@@ -55,8 +55,7 @@ import org.apache.commons.sanselan.forma
 import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 import org.apache.commons.sanselan.util.Debug;
 
-public class JpegImageParser extends ImageParser implements JpegConstants,
-        TiffTagConstants
+public class JpegImageParser extends ImageParser implements JpegConstants
 {
     public JpegImageParser()
     {
@@ -735,19 +734,19 @@ public class JpegImageParser extends Ima
             {
                 {
                     TiffField field = metadata
-                            .findEXIFValue(TIFF_TAG_XRESOLUTION);
+                            .findEXIFValue(TiffTagConstants.XRESOLUTION.tagInfo);
                     if (field != null)
                         x_density = ((Number) field.getValue()).doubleValue();
                 }
                 {
                     TiffField field = metadata
-                            .findEXIFValue(TIFF_TAG_YRESOLUTION);
+                            .findEXIFValue(TiffTagConstants.YRESOLUTION.tagInfo);
                     if (field != null)
                         y_density = ((Number) field.getValue()).doubleValue();
                 }
                 {
                     TiffField field = metadata
-                            .findEXIFValue(TIFF_TAG_RESOLUTION_UNIT);
+                            .findEXIFValue(TiffTagConstants.RESOLUTION_UNIT.tagInfo);
                     if (field != null)
                     {
                         int density_units = ((Number) field.getValue())

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffDirectory.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffDirectory.java?rev=1241084&r1=1241083&r2=1241084&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffDirectory.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffDirectory.java Mon Feb  6 17:19:47 2012
@@ -25,6 +25,7 @@ import java.util.Map;
 import org.apache.commons.sanselan.ImageReadException;
 import org.apache.commons.sanselan.formats.tiff.constants.TagInfo;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffConstants;
+import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 
 public class TiffDirectory extends TiffElement implements TiffConstants
 //extends BinaryFileFunctions
@@ -120,7 +121,7 @@ public class TiffDirectory extends TiffE
 
     public boolean hasJpegImageData() throws ImageReadException
     {
-        if (null != findField(TIFF_TAG_JPEG_INTERCHANGE_FORMAT))
+        if (null != findField(TiffTagConstants.JPEG_INTERCHANGE_FORMAT.tagInfo))
             return true;
 
         return false;
@@ -128,10 +129,10 @@ public class TiffDirectory extends TiffE
 
     public boolean hasTiffImageData() throws ImageReadException
     {
-        if (null != findField(TIFF_TAG_TILE_OFFSETS))
+        if (null != findField(TiffTagConstants.TILE_OFFSETS.tagInfo))
             return true;
 
-        if (null != findField(TIFF_TAG_STRIP_OFFSETS))
+        if (null != findField(TiffTagConstants.STRIP_OFFSETS.tagInfo))
             return true;
 
         return false;
@@ -213,10 +214,10 @@ public class TiffDirectory extends TiffE
 
     public List<ImageDataElement> getTiffRawImageDataElements() throws ImageReadException
     {
-        TiffField tileOffsets = findField(TIFF_TAG_TILE_OFFSETS);
-        TiffField tileByteCounts = findField(TIFF_TAG_TILE_BYTE_COUNTS);
-        TiffField stripOffsets = findField(TIFF_TAG_STRIP_OFFSETS);
-        TiffField stripByteCounts = findField(TIFF_TAG_STRIP_BYTE_COUNTS);
+        TiffField tileOffsets = findField(TiffTagConstants.TILE_OFFSETS.tagInfo);
+        TiffField tileByteCounts = findField(TiffTagConstants.TILE_BYTE_COUNTS.tagInfo);
+        TiffField stripOffsets = findField(TiffTagConstants.STRIP_OFFSETS.tagInfo);
+        TiffField stripByteCounts = findField(TiffTagConstants.STRIP_BYTE_COUNTS.tagInfo);
 
         if ((tileOffsets != null) && (tileByteCounts != null))
         {
@@ -232,10 +233,10 @@ public class TiffDirectory extends TiffE
 
     public boolean imageDataInStrips() throws ImageReadException
     {
-        TiffField tileOffsets = findField(TIFF_TAG_TILE_OFFSETS);
-        TiffField tileByteCounts = findField(TIFF_TAG_TILE_BYTE_COUNTS);
-        TiffField stripOffsets = findField(TIFF_TAG_STRIP_OFFSETS);
-        TiffField stripByteCounts = findField(TIFF_TAG_STRIP_BYTE_COUNTS);
+        TiffField tileOffsets = findField(TiffTagConstants.TILE_OFFSETS.tagInfo);
+        TiffField tileByteCounts = findField(TiffTagConstants.TILE_BYTE_COUNTS.tagInfo);
+        TiffField stripOffsets = findField(TiffTagConstants.STRIP_OFFSETS.tagInfo);
+        TiffField stripByteCounts = findField(TiffTagConstants.STRIP_BYTE_COUNTS.tagInfo);
 
         if ((tileOffsets != null) && (tileByteCounts != null))
             return false;
@@ -250,8 +251,8 @@ public class TiffDirectory extends TiffE
     public ImageDataElement getJpegRawImageDataElement()
             throws ImageReadException
     {
-        TiffField jpegInterchangeFormat = findField(TIFF_TAG_JPEG_INTERCHANGE_FORMAT);
-        TiffField jpegInterchangeFormatLength = findField(TIFF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH);
+        TiffField jpegInterchangeFormat = findField(TiffTagConstants.JPEG_INTERCHANGE_FORMAT.tagInfo);
+        TiffField jpegInterchangeFormatLength = findField(TiffTagConstants.JPEG_INTERCHANGE_FORMAT_LENGTH.tagInfo);
 
         if ((jpegInterchangeFormat != null)
                 && (jpegInterchangeFormatLength != null))

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffField.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffField.java?rev=1241084&r1=1241083&r2=1241084&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffField.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffField.java Mon Feb  6 17:19:47 2012
@@ -30,6 +30,7 @@ import org.apache.commons.sanselan.Image
 import org.apache.commons.sanselan.common.bytesource.ByteSource;
 import org.apache.commons.sanselan.formats.tiff.constants.TagInfo;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffConstants;
+import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 import org.apache.commons.sanselan.formats.tiff.fieldtypes.FieldType;
 
 public class TiffField implements TiffConstants
@@ -192,7 +193,7 @@ public class TiffField implements TiffCo
         // return tagInfo;
         // }
 
-        return TIFF_TAG_UNKNOWN;
+        return TiffTagConstants.UNKNOWN.tagInfo;
 
         // if (true)
         // throw new Error("Why didn't this algorithm work?");
@@ -255,7 +256,7 @@ public class TiffField implements TiffCo
 
         if (null == possibleMatches)
         {
-            return TIFF_TAG_UNKNOWN;
+            return TiffTagConstants.UNKNOWN.tagInfo;
         }
 
         TagInfo result = getTag(directoryType, tag, possibleMatches);
@@ -546,7 +547,7 @@ public class TiffField implements TiffCo
 
     public String getTagName()
     {
-        if (tagInfo == TIFF_TAG_UNKNOWN)
+        if (tagInfo == TiffTagConstants.UNKNOWN.tagInfo)
             return tagInfo.name + " (0x" + Integer.toHexString(tag) + ")";
         return tagInfo.name;
     }
@@ -611,7 +612,7 @@ public class TiffField implements TiffCo
 
     private static final Map<Object, List<TagInfo>> GPS_TAG_MAP = makeTagMap(ALL_GPS_TAGS, false,
             "GPS");
-    private static final Map<Object, List<TagInfo>> TIFF_TAG_MAP = makeTagMap(ALL_TIFF_TAGS, false,
+    private static final Map<Object, List<TagInfo>> TIFF_TAG_MAP = makeTagMap(TiffTagConstants.ALL_TIFF_TAGS, false,
             "TIFF");
     private static final Map<Object, List<TagInfo>> EXIF_TAG_MAP = makeTagMap(ALL_EXIF_TAGS, true,
             "EXIF");

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffImageParser.java?rev=1241084&r1=1241083&r2=1241084&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffImageParser.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffImageParser.java Mon Feb  6 17:19:47 2012
@@ -37,6 +37,7 @@ import org.apache.commons.sanselan.commo
 import org.apache.commons.sanselan.common.bytesource.ByteSource;
 import org.apache.commons.sanselan.formats.tiff.TiffDirectory.ImageDataElement;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffConstants;
+import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 import org.apache.commons.sanselan.formats.tiff.datareaders.DataReader;
 import org.apache.commons.sanselan.formats.tiff.photometricinterpreters.PhotometricInterpreter;
 import org.apache.commons.sanselan.formats.tiff.photometricinterpreters.PhotometricInterpreterBiLevel;
@@ -102,8 +103,8 @@ public class TiffImageParser extends Ima
                 .readFirstDirectory(byteSource, params, false, formatCompliance);
         TiffDirectory directory = contents.directories.get(0);
 
-        int width = directory.findField(TIFF_TAG_IMAGE_WIDTH).getIntValue();
-        int height = directory.findField(TIFF_TAG_IMAGE_LENGTH).getIntValue();
+        int width = directory.findField(TiffTagConstants.IMAGE_WIDTH.tagInfo).getIntValue();
+        int height = directory.findField(TiffTagConstants.IMAGE_LENGTH.tagInfo).getIntValue();
 
         return new Dimension(width, height);
     }
@@ -157,9 +158,9 @@ public class TiffImageParser extends Ima
                 .readDirectories(byteSource, false, formatCompliance);
         TiffDirectory directory = contents.directories.get(0);
 
-        TiffField widthField = directory.findField(TIFF_TAG_IMAGE_WIDTH, true);
+        TiffField widthField = directory.findField(TiffTagConstants.IMAGE_WIDTH.tagInfo, true);
         TiffField heightField = directory
-                .findField(TIFF_TAG_IMAGE_LENGTH, true);
+                .findField(TiffTagConstants.IMAGE_LENGTH.tagInfo, true);
 
         if ((widthField == null) || (heightField == null))
             throw new ImageReadException("TIFF image missing size info.");
@@ -170,7 +171,7 @@ public class TiffImageParser extends Ima
         // -------------------
 
         TiffField resolutionUnitField = directory
-                .findField(TIFF_TAG_RESOLUTION_UNIT);
+                .findField(TiffTagConstants.RESOLUTION_UNIT.tagInfo);
         int resolutionUnit = 2; // Inch
         if ((resolutionUnitField != null)
                 && (resolutionUnitField.getValue() != null))
@@ -191,8 +192,8 @@ public class TiffImageParser extends Ima
             break;
 
         }
-        TiffField xResolutionField = directory.findField(TIFF_TAG_XRESOLUTION);
-        TiffField yResolutionField = directory.findField(TIFF_TAG_YRESOLUTION);
+        TiffField xResolutionField = directory.findField(TiffTagConstants.XRESOLUTION.tagInfo);
+        TiffField yResolutionField = directory.findField(TiffTagConstants.YRESOLUTION.tagInfo);
 
         int physicalWidthDpi = -1;
         float physicalWidthInch = -1;
@@ -222,7 +223,7 @@ public class TiffImageParser extends Ima
         // -------------------
 
         TiffField bitsPerSampleField = directory
-                .findField(TIFF_TAG_BITS_PER_SAMPLE);
+                .findField(TiffTagConstants.BITS_PER_SAMPLE.tagInfo);
 
         int bitsPerSample = 1;
         if ((bitsPerSampleField != null)
@@ -255,13 +256,13 @@ public class TiffImageParser extends Ima
 
         boolean isTransparent = false; // TODO: wrong
         boolean usesPalette = false;
-        TiffField colorMapField = directory.findField(TIFF_TAG_COLOR_MAP);
+        TiffField colorMapField = directory.findField(TiffTagConstants.COLOR_MAP.tagInfo);
         if (colorMapField != null)
             usesPalette = true;
 
         int colorType = ImageInfo.COLOR_TYPE_RGB;
 
-        int compression = directory.findField(TIFF_TAG_COMPRESSION)
+        int compression = directory.findField(TiffTagConstants.COMPRESSION.tagInfo)
                 .getIntValue();
         String compressionAlgorithm;
 
@@ -313,7 +314,7 @@ public class TiffImageParser extends Ima
                 .readDirectories(byteSource, false, formatCompliance);
         TiffDirectory directory = contents.directories.get(0);
 
-        TiffField xmpField = directory.findField(TIFF_TAG_XMP, false);
+        TiffField xmpField = directory.findField(TiffTagConstants.XMP.tagInfo, false);
         if (xmpField == null)
             return null;
 
@@ -471,20 +472,20 @@ public class TiffImageParser extends Ima
             throw new ImageReadException("TIFF missing entries");
 
         int photometricInterpretation = directory.findField(
-                TIFF_TAG_PHOTOMETRIC_INTERPRETATION, true).getIntValue();
-        int compression = directory.findField(TIFF_TAG_COMPRESSION, true)
+                TiffTagConstants.PHOTOMETRIC_INTERPRETATION.tagInfo, true).getIntValue();
+        int compression = directory.findField(TiffTagConstants.COMPRESSION.tagInfo, true)
                 .getIntValue();
-        int width = directory.findField(TIFF_TAG_IMAGE_WIDTH, true)
+        int width = directory.findField(TiffTagConstants.IMAGE_WIDTH.tagInfo, true)
                 .getIntValue();
-        int height = directory.findField(TIFF_TAG_IMAGE_LENGTH, true)
+        int height = directory.findField(TiffTagConstants.IMAGE_LENGTH.tagInfo, true)
                 .getIntValue();
         int samplesPerPixel = 1;
-        TiffField samplesPerPixelField = directory.findField(TIFF_TAG_SAMPLES_PER_PIXEL);
+        TiffField samplesPerPixelField = directory.findField(TiffTagConstants.SAMPLES_PER_PIXEL.tagInfo);
         if (samplesPerPixelField != null)
             samplesPerPixel = samplesPerPixelField.getIntValue();
         int bitsPerSample[] = { 1 };
         int bitsPerPixel = samplesPerPixel;
-        TiffField bitsPerSampleField = directory.findField(TIFF_TAG_BITS_PER_SAMPLE);
+        TiffField bitsPerSampleField = directory.findField(TiffTagConstants.BITS_PER_SAMPLE.tagInfo);
         if (bitsPerSampleField != null)
         {
             bitsPerSample = bitsPerSampleField.getIntArrayValue();
@@ -501,7 +502,7 @@ public class TiffImageParser extends Ima
             // dumpOptionalNumberTag(entries, TIFF_TAG_FREE_OFFSETS);
             // dumpOptionalNumberTag(entries, TIFF_TAG_ORIENTATION);
             // dumpOptionalNumberTag(entries, TIFF_TAG_PLANAR_CONFIGURATION);
-            TiffField predictorField = directory.findField(TIFF_TAG_PREDICTOR);
+            TiffField predictorField = directory.findField(TiffTagConstants.PREDICTOR.tagInfo);
             if (null != predictorField)
                 predictor = predictorField.getIntValueOrArraySum();
         }
@@ -548,7 +549,7 @@ public class TiffImageParser extends Ima
                     invert);
         case 3: // Palette
         {
-            int colorMap[] = directory.findField(TIFF_TAG_COLOR_MAP, true)
+            int colorMap[] = directory.findField(TiffTagConstants.COLOR_MAP.tagInfo, true)
                     .getIntArrayValue();
 
             int expected_colormap_size = 3 * (1 << bitsPerPixel);
@@ -570,15 +571,15 @@ public class TiffImageParser extends Ima
         case 6: //
         {
             double yCbCrCoefficients[] = directory.findField(
-                    TIFF_TAG_YCBCR_COEFFICIENTS, true).getDoubleArrayValue();
+                    TiffTagConstants.YCBCR_COEFFICIENTS.tagInfo, true).getDoubleArrayValue();
 
             int yCbCrPositioning[] = directory.findField(
-                    TIFF_TAG_YCBCR_POSITIONING, true).getIntArrayValue();
+                    TiffTagConstants.YCBCR_POSITIONING.tagInfo, true).getIntArrayValue();
             int yCbCrSubSampling[] = directory.findField(
-                    TIFF_TAG_YCBCR_SUB_SAMPLING, true).getIntArrayValue();
+                    TiffTagConstants.YCBCR_SUB_SAMPLING.tagInfo, true).getIntArrayValue();
 
             double referenceBlackWhite[] = directory.findField(
-                    TIFF_TAG_REFERENCE_BLACK_WHITE, true).getDoubleArrayValue();
+                    TiffTagConstants.REFERENCE_BLACK_WHITE.tagInfo, true).getDoubleArrayValue();
 
             return new PhotometricInterpreterYCbCr(yCbCrCoefficients,
                     yCbCrPositioning, yCbCrSubSampling, referenceBlackWhite,

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffReader.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffReader.java?rev=1241084&r1=1241083&r2=1241084&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffReader.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffReader.java Mon Feb  6 17:19:47 2012
@@ -28,6 +28,7 @@ import org.apache.commons.sanselan.commo
 import org.apache.commons.sanselan.common.bytesource.ByteSource;
 import org.apache.commons.sanselan.formats.tiff.TiffDirectory.ImageDataElement;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffConstants;
+import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 import org.apache.commons.sanselan.util.Debug;
 
 public class TiffReader extends BinaryFileParser implements TiffConstants
@@ -477,7 +478,7 @@ public class TiffReader extends BinaryFi
         if (directory.imageDataInStrips())
         {
             TiffField rowsPerStripField = directory
-                    .findField(TIFF_TAG_ROWS_PER_STRIP);
+                    .findField(TiffTagConstants.ROWS_PER_STRIP.tagInfo);
             if (null == rowsPerStripField)
                 throw new ImageReadException("Can't find rows per strip field.");
             int rowsPerStrip = rowsPerStripField.getIntValue();
@@ -485,13 +486,13 @@ public class TiffReader extends BinaryFi
             return new TiffImageData.Strips(data, rowsPerStrip);
         } else
         {
-            TiffField tileWidthField = directory.findField(TIFF_TAG_TILE_WIDTH);
+            TiffField tileWidthField = directory.findField(TiffTagConstants.TILE_WIDTH.tagInfo);
             if (null == tileWidthField)
                 throw new ImageReadException("Can't find tile width field.");
             int tileWidth = tileWidthField.getIntValue();
 
             TiffField tileLengthField = directory
-                    .findField(TIFF_TAG_TILE_LENGTH);
+                    .findField(TiffTagConstants.TILE_LENGTH.tagInfo);
             if (null == tileLengthField)
                 throw new ImageReadException("Can't find tile length field.");
             int tileLength = tileLengthField.getIntValue();

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/AllTagConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/AllTagConstants.java?rev=1241084&r1=1241083&r2=1241084&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/AllTagConstants.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/AllTagConstants.java Mon Feb  6 17:19:47 2012
@@ -21,13 +21,11 @@ import org.apache.commons.sanselan.Sanse
 public interface AllTagConstants
         extends
             SanselanConstants,
-            TiffTagConstants,
             ExifTagConstants,
             GpsTagConstants
 {
-    public static final TagInfo ALL_TAGS[] = TagConstantsUtils
-            .mergeTagLists(new TagInfo[][]{
-                    ALL_TIFF_TAGS, ALL_EXIF_TAGS, ALL_GPS_TAGS,
-            });
+    public static final TagInfo ALL_TAGS[] = TagConstantsUtils.mergeTagLists(new TagInfo[][]{
+                TiffTagConstants.ALL_TIFF_TAGS, ALL_EXIF_TAGS, ALL_GPS_TAGS,
+        });
 
 }
\ No newline at end of file

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffTagConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffTagConstants.java?rev=1241084&r1=1241083&r2=1241084&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffTagConstants.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffTagConstants.java Mon Feb  6 17:19:47 2012
@@ -16,334 +16,307 @@
  */
 package org.apache.commons.sanselan.formats.tiff.constants;
 
-public interface TiffTagConstants
-        extends
-            TiffDirectoryConstants,
-            TiffFieldTypeConstants
+public enum TiffTagConstants implements TiffFieldTypeConstants, TiffDirectoryConstants
 {
 
-    public static final TagInfo TIFF_TAG_NEW_SUBFILE_TYPE = new TagInfo(
+    NEW_SUBFILE_TYPE(new TagInfo(
             "New Subfile Type", 0xFE, FIELD_TYPE_DESCRIPTION_LONG, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_SUBFILE_TYPE = new TagInfo(
+    SUBFILE_TYPE(new TagInfo(
             "Subfile Type", 0xFF, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_IMAGE_WIDTH = new TagInfo(
+    IMAGE_WIDTH(new TagInfo(
             "Image Width", 0x100, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_IMAGE_LENGTH = new TagInfo(
+    IMAGE_LENGTH(new TagInfo(
             "Image Length", 0x101, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_BITS_PER_SAMPLE = new TagInfo(
+    BITS_PER_SAMPLE(new TagInfo(
             "Bits Per Sample", 0x102, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_COMPRESSION = new TagInfo(
+    COMPRESSION(new TagInfo(
             "Compression", 0x103, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_PHOTOMETRIC_INTERPRETATION = new TagInfo(
+    PHOTOMETRIC_INTERPRETATION(new TagInfo(
             "Photometric Interpretation", 0x106, FIELD_TYPE_DESCRIPTION_SHORT,
-            1, TIFF_DIRECTORY_ROOT);
+            1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_THRESHHOLDING = new TagInfo(
+    THRESHHOLDING(new TagInfo(
             "Threshholding", 0x107, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_CELL_WIDTH = new TagInfo("Cell Width",
-            0x108, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT);
+    CELL_WIDTH(new TagInfo("Cell Width",
+            0x108, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_CELL_LENGTH = new TagInfo(
+    CELL_LENGTH(new TagInfo(
             "Cell Length", 0x109, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_FILL_ORDER = new TagInfo("Fill Order",
-            0x10A, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT);
+    FILL_ORDER(new TagInfo("Fill Order",
+            0x10A, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_DOCUMENT_NAME = new TagInfo(
+    DOCUMENT_NAME(new TagInfo(
             "Document Name", 0x10D, FIELD_TYPE_DESCRIPTION_ASCII, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_IMAGE_DESCRIPTION = new TagInfo(
+    IMAGE_DESCRIPTION(new TagInfo(
             "Image Description", 0x10E, FIELD_TYPE_DESCRIPTION_ASCII, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_MAKE = new TagInfo("Make", 0x10F,
-            FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT);
+    MAKE(new TagInfo("Make", 0x10F,
+            FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_MODEL = new TagInfo("Model", 0x110,
-            FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT);
+    MODEL(new TagInfo("Model", 0x110,
+            FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_STRIP_OFFSETS = new TagInfo.Offset(
+    STRIP_OFFSETS(new TagInfo.Offset(
             "Strip Offsets", 0x111, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_ORIENTATION = new TagInfo(
+    ORIENTATION(new TagInfo(
             "Orientation", 0x112, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_SAMPLES_PER_PIXEL = new TagInfo(
+    SAMPLES_PER_PIXEL(new TagInfo(
             "Samples Per Pixel", 0x115, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_ROWS_PER_STRIP = new TagInfo(
+    ROWS_PER_STRIP(new TagInfo(
             "Rows Per Strip", 0x116, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_STRIP_BYTE_COUNTS = new TagInfo(
+    STRIP_BYTE_COUNTS(new TagInfo(
             "Strip Byte Counts", 0x117, FIELD_TYPE_DESCRIPTION_LONG_OR_SHORT,
-            -1, TIFF_DIRECTORY_ROOT);
+            -1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_MIN_SAMPLE_VALUE = new TagInfo(
+    MIN_SAMPLE_VALUE(new TagInfo(
             "Min Sample Value", 0x118, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_MAX_SAMPLE_VALUE = new TagInfo(
+    MAX_SAMPLE_VALUE(new TagInfo(
             "Max Sample Value", 0x119, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_XRESOLUTION = new TagInfo(
+    XRESOLUTION(new TagInfo(
             "XResolution", 0x11A, FIELD_TYPE_DESCRIPTION_RATIONAL, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_YRESOLUTION = new TagInfo(
+    YRESOLUTION(new TagInfo(
             "YResolution", 0x11B, FIELD_TYPE_DESCRIPTION_RATIONAL, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_PLANAR_CONFIGURATION = new TagInfo(
+    PLANAR_CONFIGURATION(new TagInfo(
             "Planar Configuration", 0x11C, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_PAGE_NAME = new TagInfo("Page Name",
-            0x11D, FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT);
+    PAGE_NAME(new TagInfo("Page Name",
+            0x11D, FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_XPOSITION = new TagInfo("XPosition",
-            0x11E, FIELD_TYPE_DESCRIPTION_RATIONAL, -1, TIFF_DIRECTORY_ROOT);
+    XPOSITION(new TagInfo("XPosition",
+            0x11E, FIELD_TYPE_DESCRIPTION_RATIONAL, -1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_YPOSITION = new TagInfo("YPosition",
-            0x11F, FIELD_TYPE_DESCRIPTION_RATIONAL, -1, TIFF_DIRECTORY_ROOT);
+    YPOSITION(new TagInfo("YPosition",
+            0x11F, FIELD_TYPE_DESCRIPTION_RATIONAL, -1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_FREE_OFFSETS = new TagInfo(
+    FREE_OFFSETS(new TagInfo(
             "Free Offsets", 0x120, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_FREE_BYTE_COUNTS = new TagInfo(
+    FREE_BYTE_COUNTS(new TagInfo(
             "Free Byte Counts", 0x121, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_GRAY_RESPONSE_UNIT = new TagInfo(
+    GRAY_RESPONSE_UNIT(new TagInfo(
             "Gray Response Unit", 0x122, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_GRAY_RESPONSE_CURVE = new TagInfo(
+    GRAY_RESPONSE_CURVE(new TagInfo(
             "Gray Response Curve", 0x123, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_T4_OPTIONS = new TagInfo("T4 Options",
-            0x124, FIELD_TYPE_DESCRIPTION_LONG, 1, TIFF_DIRECTORY_ROOT);
+    T4_OPTIONS(new TagInfo("T4 Options",
+            0x124, FIELD_TYPE_DESCRIPTION_LONG, 1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_T6_OPTIONS = new TagInfo("T6 Options",
-            0x125, FIELD_TYPE_DESCRIPTION_LONG, 1, TIFF_DIRECTORY_ROOT);
+    T6_OPTIONS(new TagInfo("T6 Options",
+            0x125, FIELD_TYPE_DESCRIPTION_LONG, 1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_RESOLUTION_UNIT = new TagInfo(
+    RESOLUTION_UNIT(new TagInfo(
             "Resolution Unit", 0x128, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_PAGE_NUMBER = new TagInfo(
+    PAGE_NUMBER(new TagInfo(
             "Page Number", 0x129, FIELD_TYPE_DESCRIPTION_SHORT, 2,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_TRANSFER_FUNCTION = new TagInfo(
+    TRANSFER_FUNCTION(new TagInfo(
             "Transfer Function", 0x12D, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_SOFTWARE = new TagInfo("Software",
-            0x131, FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT);
+    SOFTWARE(new TagInfo("Software",
+            0x131, FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_DATE_TIME = new TagInfo("Date Time",
-            0x132, FIELD_TYPE_DESCRIPTION_ASCII, 20, TIFF_DIRECTORY_ROOT);
+    DATE_TIME(new TagInfo("Date Time",
+            0x132, FIELD_TYPE_DESCRIPTION_ASCII, 20, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_ARTIST = new TagInfo("Artist", 0x13B,
-            FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT);
+    ARTIST(new TagInfo("Artist", 0x13B,
+            FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_HOST_COMPUTER = new TagInfo(
+    HOST_COMPUTER(new TagInfo(
             "Host Computer", 0x13C, FIELD_TYPE_DESCRIPTION_ASCII, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_PREDICTOR = new TagInfo("Predictor",
-            0x13D, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT);
+    PREDICTOR(new TagInfo("Predictor",
+            0x13D, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_WHITE_POINT = new TagInfo(
+    WHITE_POINT(new TagInfo(
             "White Point", 0x13E, FIELD_TYPE_DESCRIPTION_RATIONAL, 2,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_PRIMARY_CHROMATICITIES = new TagInfo(
+    PRIMARY_CHROMATICITIES(new TagInfo(
             "Primary Chromaticities", 0x13F, FIELD_TYPE_DESCRIPTION_RATIONAL,
-            6, TIFF_DIRECTORY_ROOT);
+            6, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_COLOR_MAP = new TagInfo("Color Map",
-            0x140, FIELD_TYPE_DESCRIPTION_SHORT, -1, TIFF_DIRECTORY_ROOT);
+    COLOR_MAP(new TagInfo("Color Map",
+            0x140, FIELD_TYPE_DESCRIPTION_SHORT, -1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_HALFTONE_HINTS = new TagInfo(
+    HALFTONE_HINTS(new TagInfo(
             "Halftone Hints", 0x141, FIELD_TYPE_DESCRIPTION_SHORT, 2,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_TILE_WIDTH = new TagInfo("Tile Width",
-            0x142, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, 1, TIFF_DIRECTORY_ROOT);
+    TILE_WIDTH(new TagInfo("Tile Width",
+            0x142, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, 1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_TILE_LENGTH = new TagInfo(
+    TILE_LENGTH(new TagInfo(
             "Tile Length", 0x143, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_TILE_OFFSETS = new TagInfo.Offset(
+    TILE_OFFSETS(new TagInfo.Offset(
             "Tile Offsets", 0x144, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_TILE_BYTE_COUNTS = new TagInfo(
+    TILE_BYTE_COUNTS(new TagInfo(
             "Tile Byte Counts", 0x145, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG,
-            -1, TIFF_DIRECTORY_ROOT);
+            -1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_INK_SET = new TagInfo("Ink Set",
-            0x14C, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT);
+    INK_SET(new TagInfo("Ink Set",
+            0x14C, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_INK_NAMES = new TagInfo("Ink Names",
-            0x14D, FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT);
+    INK_NAMES(new TagInfo("Ink Names",
+            0x14D, FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_NUMBER_OF_INKS = new TagInfo(
+    NUMBER_OF_INKS(new TagInfo(
             "Number Of Inks", 0x14E, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_DOT_RANGE = new TagInfo("Dot Range",
+    DOT_RANGE(new TagInfo("Dot Range",
             0x150, FIELD_TYPE_DESCRIPTION_BYTE_OR_SHORT, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_TARGET_PRINTER = new TagInfo(
+    TARGET_PRINTER(new TagInfo(
             "Target Printer", 0x151, FIELD_TYPE_DESCRIPTION_ASCII, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_EXTRA_SAMPLES = new TagInfo(
+    EXTRA_SAMPLES(new TagInfo(
             "Extra Samples", 0x152, FIELD_TYPE_DESCRIPTION_BYTE, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_SAMPLE_FORMAT = new TagInfo(
+    SAMPLE_FORMAT(new TagInfo(
             "Sample Format", 0x153, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_SMIN_SAMPLE_VALUE = new TagInfo(
+    SMIN_SAMPLE_VALUE(new TagInfo(
             "SMin Sample Value", 0x154, FIELD_TYPE_DESCRIPTION_ANY, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_SMAX_SAMPLE_VALUE = new TagInfo(
+    SMAX_SAMPLE_VALUE(new TagInfo(
             "SMax Sample Value", 0x155, FIELD_TYPE_DESCRIPTION_ANY, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_TRANSFER_RANGE = new TagInfo(
+    TRANSFER_RANGE(new TagInfo(
             "Transfer Range", 0x156, FIELD_TYPE_DESCRIPTION_SHORT, 6,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_JPEG_PROC = new TagInfo("JPEGProc",
-            0x200, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT);
+    JPEG_PROC(new TagInfo("JPEGProc",
+            0x200, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_JPEG_INTERCHANGE_FORMAT = new TagInfo.Offset(
+    JPEG_INTERCHANGE_FORMAT(new TagInfo.Offset(
             "JPEGInterchange Format", 0x201, FIELD_TYPE_DESCRIPTION_LONG, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH = new TagInfo(
+    JPEG_INTERCHANGE_FORMAT_LENGTH(new TagInfo(
             "JPEGInterchange Format Length", 0x202,
-            FIELD_TYPE_DESCRIPTION_LONG, 1, TIFF_DIRECTORY_ROOT);
+            FIELD_TYPE_DESCRIPTION_LONG, 1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_JPEG_RESTART_INTERVAL = new TagInfo(
+    JPEG_RESTART_INTERVAL(new TagInfo(
             "JPEGRestart Interval", 0x203, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_JPEG_LOSSLESS_PREDICTORS = new TagInfo(
+    JPEG_LOSSLESS_PREDICTORS(new TagInfo(
             "JPEGLossless Predictors", 0x205, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_JPEG_POINT_TRANSFORMS = new TagInfo(
+    JPEG_POINT_TRANSFORMS(new TagInfo(
             "JPEGPoint Transforms", 0x206, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_JPEG_QTABLES = new TagInfo(
+    JPEG_QTABLES(new TagInfo(
             "JPEGQTables", 0x207, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_JPEG_DCTABLES = new TagInfo(
+    JPEG_DCTABLES(new TagInfo(
             "JPEGDCTables", 0x208, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_JPEG_ACTABLES = new TagInfo(
+    JPEG_ACTABLES(new TagInfo(
             "JPEGACTables", 0x209, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_YCBCR_COEFFICIENTS = new TagInfo(
+    YCBCR_COEFFICIENTS(new TagInfo(
             "YCbCr Coefficients", 0x211, FIELD_TYPE_DESCRIPTION_RATIONAL, 3,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_YCBCR_SUB_SAMPLING = new TagInfo(
+    YCBCR_SUB_SAMPLING(new TagInfo(
             "YCbCr Sub Sampling", 0x212, FIELD_TYPE_DESCRIPTION_SHORT, 2,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_YCBCR_POSITIONING = new TagInfo(
+    YCBCR_POSITIONING(new TagInfo(
             "YCbCr Positioning", 0x213, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_REFERENCE_BLACK_WHITE = new TagInfo(
+    REFERENCE_BLACK_WHITE(new TagInfo(
             "Reference Black White", 0x214, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT);
+            TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_COPYRIGHT = new TagInfo("Copyright",
-            0x8298, FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT);
+    COPYRIGHT(new TagInfo("Copyright",
+            0x8298, FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
 
-    public static final TagInfo TIFF_TAG_XMP = new TagInfo("XMP",
-            0x2BC, FIELD_TYPE_DESCRIPTION_BYTE, -1, TIFF_DIRECTORY_ROOT);
+    XMP(new TagInfo("XMP",
+            0x2BC, FIELD_TYPE_DESCRIPTION_BYTE, -1, TIFF_DIRECTORY_ROOT)),
 
     // TODO:
-    //    public static final TagInfo2 TIFF_TAG_UNKNOWN = null;
-    public static final TagInfo TIFF_TAG_UNKNOWN = new TagInfo.Unknown(
+    //    public static final TagInfo2 UNKNOWN(null;
+    UNKNOWN(new TagInfo.Unknown(
             "Unknown Tag", -1, FIELD_TYPE_DESCRIPTION_UNKNOWN,
-            TagInfo.LENGTH_UNKNOWN, EXIF_DIRECTORY_UNKNOWN);
-
-    public static final TagInfo ALL_TIFF_TAGS[] = {
-            TIFF_TAG_NEW_SUBFILE_TYPE, TIFF_TAG_SUBFILE_TYPE,
-            TIFF_TAG_IMAGE_WIDTH, TIFF_TAG_IMAGE_LENGTH,
-            TIFF_TAG_BITS_PER_SAMPLE, TIFF_TAG_COMPRESSION,
-            TIFF_TAG_PHOTOMETRIC_INTERPRETATION, TIFF_TAG_THRESHHOLDING,
-            TIFF_TAG_CELL_WIDTH, TIFF_TAG_CELL_LENGTH, TIFF_TAG_FILL_ORDER,
-            TIFF_TAG_DOCUMENT_NAME, TIFF_TAG_IMAGE_DESCRIPTION, TIFF_TAG_MAKE,
-            TIFF_TAG_MODEL, TIFF_TAG_STRIP_OFFSETS, TIFF_TAG_ORIENTATION,
-            TIFF_TAG_SAMPLES_PER_PIXEL, TIFF_TAG_ROWS_PER_STRIP,
-            TIFF_TAG_STRIP_BYTE_COUNTS, TIFF_TAG_MIN_SAMPLE_VALUE,
-            TIFF_TAG_MAX_SAMPLE_VALUE, TIFF_TAG_XRESOLUTION,
-            TIFF_TAG_YRESOLUTION, TIFF_TAG_PLANAR_CONFIGURATION,
-            TIFF_TAG_PAGE_NAME, TIFF_TAG_XPOSITION, TIFF_TAG_YPOSITION,
-            TIFF_TAG_FREE_OFFSETS, TIFF_TAG_FREE_BYTE_COUNTS,
-            TIFF_TAG_GRAY_RESPONSE_UNIT, TIFF_TAG_GRAY_RESPONSE_CURVE,
-            TIFF_TAG_T4_OPTIONS, TIFF_TAG_T6_OPTIONS, TIFF_TAG_RESOLUTION_UNIT,
-            TIFF_TAG_PAGE_NUMBER, TIFF_TAG_TRANSFER_FUNCTION,
-            TIFF_TAG_SOFTWARE, TIFF_TAG_DATE_TIME, TIFF_TAG_ARTIST,
-            TIFF_TAG_HOST_COMPUTER, TIFF_TAG_PREDICTOR, TIFF_TAG_WHITE_POINT,
-            TIFF_TAG_PRIMARY_CHROMATICITIES, TIFF_TAG_COLOR_MAP,
-            TIFF_TAG_HALFTONE_HINTS, TIFF_TAG_TILE_WIDTH, TIFF_TAG_TILE_LENGTH,
-            TIFF_TAG_TILE_OFFSETS, TIFF_TAG_TILE_BYTE_COUNTS, TIFF_TAG_INK_SET,
-            TIFF_TAG_INK_NAMES, TIFF_TAG_NUMBER_OF_INKS, TIFF_TAG_DOT_RANGE,
-            TIFF_TAG_TARGET_PRINTER, TIFF_TAG_EXTRA_SAMPLES,
-            TIFF_TAG_SAMPLE_FORMAT, TIFF_TAG_SMIN_SAMPLE_VALUE,
-            TIFF_TAG_SMAX_SAMPLE_VALUE, TIFF_TAG_TRANSFER_RANGE,
-            TIFF_TAG_JPEG_PROC, TIFF_TAG_JPEG_INTERCHANGE_FORMAT,
-            TIFF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH,
-            TIFF_TAG_JPEG_RESTART_INTERVAL, TIFF_TAG_JPEG_LOSSLESS_PREDICTORS,
-            TIFF_TAG_JPEG_POINT_TRANSFORMS, TIFF_TAG_JPEG_QTABLES,
-            TIFF_TAG_JPEG_DCTABLES, TIFF_TAG_JPEG_ACTABLES,
-            TIFF_TAG_YCBCR_COEFFICIENTS, TIFF_TAG_YCBCR_SUB_SAMPLING,
-            TIFF_TAG_YCBCR_POSITIONING, TIFF_TAG_REFERENCE_BLACK_WHITE,
-            TIFF_TAG_COPYRIGHT,
-            //
-            TIFF_TAG_XMP,
-    };
-
+            TagInfo.LENGTH_UNKNOWN, EXIF_DIRECTORY_UNKNOWN));
+    
+    public final TagInfo tagInfo;
+    
+    TiffTagConstants(TagInfo tagInfo) {
+        this.tagInfo = tagInfo;
+    }
+    
+    public static final TagInfo[] ALL_TIFF_TAGS;
+    static {
+        TiffTagConstants[] tiffTagConstants = values();
+        ALL_TIFF_TAGS = new TagInfo[tiffTagConstants.length];
+        for (int i = 0; i < tiffTagConstants.length; i++) {
+            ALL_TIFF_TAGS[i] = tiffTagConstants[i].tagInfo;
+        }
+    }
 }
\ No newline at end of file

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/datareaders/DataReader.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/datareaders/DataReader.java?rev=1241084&r1=1241083&r2=1241084&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/datareaders/DataReader.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/datareaders/DataReader.java Mon Feb  6 17:19:47 2012
@@ -30,6 +30,7 @@ import org.apache.commons.sanselan.commo
 import org.apache.commons.sanselan.formats.tiff.TiffDirectory;
 import org.apache.commons.sanselan.formats.tiff.TiffField;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffConstants;
+import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 import org.apache.commons.sanselan.formats.tiff.photometricinterpreters.PhotometricInterpreter;
 
 public abstract class DataReader implements TiffConstants, BinaryConstants
@@ -109,7 +110,7 @@ public abstract class DataReader impleme
     protected byte[] decompress(byte compressed[], int compression,
             int expected_size, int tileWidth, int tileHeight) throws ImageReadException, IOException
     {
-        TiffField fillOrderField = directory.findField(TIFF_TAG_FILL_ORDER);
+        TiffField fillOrderField = directory.findField(TiffTagConstants.FILL_ORDER.tagInfo);
         int fillOrder = 1;
         if (fillOrderField != null) {
             fillOrder = fillOrderField.getIntValue();
@@ -133,7 +134,7 @@ public abstract class DataReader impleme
             case TIFF_COMPRESSION_CCITT_GROUP_3 :
             {
                 int t4Options = 0;
-                TiffField field = directory.findField(TIFF_TAG_T4_OPTIONS);
+                TiffField field = directory.findField(TiffTagConstants.T4_OPTIONS.tagInfo);
                 if (field != null) {
                     t4Options = field.getIntValue();
                 }
@@ -152,7 +153,7 @@ public abstract class DataReader impleme
             case TIFF_COMPRESSION_CCITT_GROUP_4 :
             {
                 int t6Options = 0;
-                TiffField field = directory.findField(TIFF_TAG_T6_OPTIONS);
+                TiffField field = directory.findField(TiffTagConstants.T6_OPTIONS.tagInfo);
                 if (field != null) {
                     t6Options = field.getIntValue();
                 }

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffImageWriterBase.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffImageWriterBase.java?rev=1241084&r1=1241083&r2=1241084&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffImageWriterBase.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffImageWriterBase.java Mon Feb  6 17:19:47 2012
@@ -36,6 +36,7 @@ import org.apache.commons.sanselan.commo
 import org.apache.commons.sanselan.formats.tiff.TiffElement;
 import org.apache.commons.sanselan.formats.tiff.TiffImageData;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffConstants;
+import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 
 public abstract class TiffImageWriterBase implements TiffConstants,
         BinaryConstants
@@ -411,21 +412,21 @@ public abstract class TiffImageWriterBas
         {
             {
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_IMAGE_WIDTH, FIELD_TYPE_LONG, 1,
+                        TiffTagConstants.IMAGE_WIDTH.tagInfo, FIELD_TYPE_LONG, 1,
                         FIELD_TYPE_LONG.writeData(new int[] { width, },
                                 byteOrder));
                 directory.add(field);
             }
             {
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_IMAGE_LENGTH, FIELD_TYPE_LONG, 1,
+                        TiffTagConstants.IMAGE_LENGTH.tagInfo, FIELD_TYPE_LONG, 1,
                         FIELD_TYPE_LONG.writeData(new int[] { height, },
                                 byteOrder));
                 directory.add(field);
             }
             {
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_PHOTOMETRIC_INTERPRETATION, FIELD_TYPE_SHORT,
+                        TiffTagConstants.PHOTOMETRIC_INTERPRETATION.tagInfo, FIELD_TYPE_SHORT,
                         1, FIELD_TYPE_SHORT.writeData(
                                 new int[] { photometricInterpretation, },
                                 byteOrder));
@@ -433,14 +434,14 @@ public abstract class TiffImageWriterBas
             }
             {
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_COMPRESSION, FIELD_TYPE_SHORT, 1,
+                        TiffTagConstants.COMPRESSION.tagInfo, FIELD_TYPE_SHORT, 1,
                         FIELD_TYPE_SHORT.writeData(new int[] { compression, },
                                 byteOrder));
                 directory.add(field);
             }
             {
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_SAMPLES_PER_PIXEL, FIELD_TYPE_SHORT, 1,
+                        TiffTagConstants.SAMPLES_PER_PIXEL.tagInfo, FIELD_TYPE_SHORT, 1,
                         FIELD_TYPE_SHORT.writeData(
                                 new int[] { samplesPerPixel, }, byteOrder));
                 directory.add(field);
@@ -449,14 +450,14 @@ public abstract class TiffImageWriterBas
             if (samplesPerPixel == 3)
             {
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_BITS_PER_SAMPLE, FIELD_TYPE_SHORT, 3,
+                        TiffTagConstants.BITS_PER_SAMPLE.tagInfo, FIELD_TYPE_SHORT, 3,
                         FIELD_TYPE_SHORT.writeData(new int[] { bitsPerSample,
                                 bitsPerSample, bitsPerSample, }, byteOrder));
                 directory.add(field);
             } else if (samplesPerPixel == 1)
             {
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_BITS_PER_SAMPLE, FIELD_TYPE_SHORT, 1,
+                        TiffTagConstants.BITS_PER_SAMPLE.tagInfo, FIELD_TYPE_SHORT, 1,
                         FIELD_TYPE_SHORT.writeData(
                                 new int[] { bitsPerSample, }, byteOrder));
                 directory.add(field);
@@ -476,7 +477,7 @@ public abstract class TiffImageWriterBas
             // }
             {
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_ROWS_PER_STRIP, FIELD_TYPE_LONG, 1,
+                        TiffTagConstants.ROWS_PER_STRIP.tagInfo, FIELD_TYPE_LONG, 1,
                         FIELD_TYPE_LONG.writeData(new int[] { rowsPerStrip, },
                                 byteOrder));
                 directory.add(field);
@@ -485,7 +486,7 @@ public abstract class TiffImageWriterBas
             {
                 int resolutionUnit = 2;// inches.
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_RESOLUTION_UNIT, FIELD_TYPE_SHORT, 1,
+                        TiffTagConstants.RESOLUTION_UNIT.tagInfo, FIELD_TYPE_SHORT, 1,
                         FIELD_TYPE_SHORT.writeData(
                                 new int[] { resolutionUnit, }, byteOrder));
                 directory.add(field);
@@ -493,7 +494,7 @@ public abstract class TiffImageWriterBas
 
             {
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_XRESOLUTION, FIELD_TYPE_RATIONAL, 1,
+                        TiffTagConstants.XRESOLUTION.tagInfo, FIELD_TYPE_RATIONAL, 1,
                         FIELD_TYPE_RATIONAL
                                 .writeData(xResolution.intValue(), 1, byteOrder));
                 directory.add(field);
@@ -501,7 +502,7 @@ public abstract class TiffImageWriterBas
 
             {
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_YRESOLUTION, FIELD_TYPE_RATIONAL, 1,
+                        TiffTagConstants.YRESOLUTION.tagInfo, FIELD_TYPE_RATIONAL, 1,
                         FIELD_TYPE_RATIONAL
                                 .writeData(yResolution.intValue(), 1, byteOrder));
                 directory.add(field);
@@ -509,14 +510,14 @@ public abstract class TiffImageWriterBas
             
             if (t4Options != 0) {
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_T4_OPTIONS, FIELD_TYPE_LONG, 1,
+                        TiffTagConstants.T4_OPTIONS.tagInfo, FIELD_TYPE_LONG, 1,
                         FIELD_TYPE_LONG
                                 .writeData(Integer.valueOf(t4Options), byteOrder));
                 directory.add(field);
             }
             if (t6Options != 0) {
                 TiffOutputField field = new TiffOutputField(
-                        TIFF_TAG_T6_OPTIONS, FIELD_TYPE_LONG, 1,
+                        TiffTagConstants.T6_OPTIONS.tagInfo, FIELD_TYPE_LONG, 1,
                         FIELD_TYPE_LONG
                                 .writeData(Integer.valueOf(t6Options), byteOrder));
                 directory.add(field);
@@ -527,7 +528,7 @@ public abstract class TiffImageWriterBas
             {
                 byte xmpXmlBytes[] = xmpXml.getBytes("utf-8");
 
-                TiffOutputField field = new TiffOutputField(TIFF_TAG_XMP,
+                TiffOutputField field = new TiffOutputField(TiffTagConstants.XMP.tagInfo,
                         FIELD_TYPE_BYTE, xmpXmlBytes.length, xmpXmlBytes);
                 directory.add(field);
             }

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffOutputDirectory.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffOutputDirectory.java?rev=1241084&r1=1241083&r2=1241084&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffOutputDirectory.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffOutputDirectory.java Mon Feb  6 17:19:47 2012
@@ -31,6 +31,7 @@ import org.apache.commons.sanselan.forma
 import org.apache.commons.sanselan.formats.tiff.constants.TagConstantsUtils;
 import org.apache.commons.sanselan.formats.tiff.constants.TagInfo;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffConstants;
+import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 import org.apache.commons.sanselan.formats.tiff.fieldtypes.FieldType;
 
 public final class TiffOutputDirectory extends TiffOutputItem implements
@@ -190,14 +191,14 @@ public final class TiffOutputDirectory e
     {
         // first validate directory fields.
 
-        removeFieldIfPresent(TIFF_TAG_JPEG_INTERCHANGE_FORMAT);
-        removeFieldIfPresent(TIFF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH);
+        removeFieldIfPresent(TiffTagConstants.JPEG_INTERCHANGE_FORMAT.tagInfo);
+        removeFieldIfPresent(TiffTagConstants.JPEG_INTERCHANGE_FORMAT_LENGTH.tagInfo);
 
         TiffOutputField jpegOffsetField = null;
         if (null != jpegImageData)
         {
             jpegOffsetField = new TiffOutputField(
-                    TIFF_TAG_JPEG_INTERCHANGE_FORMAT, FIELD_TYPE_LONG, 1,
+                    TiffTagConstants.JPEG_INTERCHANGE_FORMAT.tagInfo, FIELD_TYPE_LONG, 1,
                     FieldType.getStubLocalValue());
             add(jpegOffsetField);
 
@@ -206,7 +207,7 @@ public final class TiffOutputDirectory e
                     outputSummary.byteOrder);
 
             TiffOutputField jpegLengthField = new TiffOutputField(
-                    TIFF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH, FIELD_TYPE_LONG,
+                    TiffTagConstants.JPEG_INTERCHANGE_FORMAT_LENGTH.tagInfo, FIELD_TYPE_LONG,
                     1, lengthValue);
             add(jpegLengthField);
 
@@ -214,10 +215,10 @@ public final class TiffOutputDirectory e
 
         // --------------------------------------------------------------
 
-        removeFieldIfPresent(TIFF_TAG_STRIP_OFFSETS);
-        removeFieldIfPresent(TIFF_TAG_STRIP_BYTE_COUNTS);
-        removeFieldIfPresent(TIFF_TAG_TILE_OFFSETS);
-        removeFieldIfPresent(TIFF_TAG_TILE_BYTE_COUNTS);
+        removeFieldIfPresent(TiffTagConstants.STRIP_OFFSETS.tagInfo);
+        removeFieldIfPresent(TiffTagConstants.STRIP_BYTE_COUNTS.tagInfo);
+        removeFieldIfPresent(TiffTagConstants.TILE_OFFSETS.tagInfo);
+        removeFieldIfPresent(TiffTagConstants.TILE_BYTE_COUNTS.tagInfo);
 
         TiffOutputField imageDataOffsetField;
         ImageDataOffsets imageDataInfo = null;
@@ -229,12 +230,12 @@ public final class TiffOutputDirectory e
             TagInfo byteCountsTag;
             if (stripsNotTiles)
             {
-                offsetTag = TIFF_TAG_STRIP_OFFSETS;
-                byteCountsTag = TIFF_TAG_STRIP_BYTE_COUNTS;
+                offsetTag = TiffTagConstants.STRIP_OFFSETS.tagInfo;
+                byteCountsTag = TiffTagConstants.STRIP_BYTE_COUNTS.tagInfo;
             } else
             {
-                offsetTag = TIFF_TAG_TILE_OFFSETS;
-                byteCountsTag = TIFF_TAG_TILE_BYTE_COUNTS;
+                offsetTag = TiffTagConstants.TILE_OFFSETS.tagInfo;
+                byteCountsTag = TiffTagConstants.TILE_BYTE_COUNTS.tagInfo;
             }
 
             // --------

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/MetadataExample.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/MetadataExample.java?rev=1241084&r1=1241083&r2=1241084&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/MetadataExample.java (original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/MetadataExample.java Mon Feb  6 17:19:47 2012
@@ -29,6 +29,7 @@ import org.apache.commons.sanselan.forma
 import org.apache.commons.sanselan.formats.tiff.TiffImageMetadata;
 import org.apache.commons.sanselan.formats.tiff.constants.TagInfo;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffConstants;
+import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 
 public class MetadataExample
 {
@@ -55,8 +56,8 @@ public class MetadataExample
             System.out.println("file: " + file.getPath());
 
             // print out various interesting EXIF tags.
-            printTagValue(jpegMetadata, TiffConstants.TIFF_TAG_XRESOLUTION);
-            printTagValue(jpegMetadata, TiffConstants.TIFF_TAG_DATE_TIME);
+            printTagValue(jpegMetadata, TiffTagConstants.XRESOLUTION.tagInfo);
+            printTagValue(jpegMetadata, TiffTagConstants.DATE_TIME.tagInfo);
             printTagValue(jpegMetadata,
                     TiffConstants.EXIF_TAG_DATE_TIME_ORIGINAL);
             printTagValue(jpegMetadata, TiffConstants.EXIF_TAG_CREATE_DATE);

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/WriteTagsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/WriteTagsTest.java?rev=1241084&r1=1241083&r2=1241084&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/WriteTagsTest.java (original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/WriteTagsTest.java Mon Feb  6 17:19:47 2012
@@ -20,6 +20,7 @@ package org.apache.commons.sanselan.form
 import org.apache.commons.sanselan.SanselanConstants;
 import org.apache.commons.sanselan.common.BinaryConstants;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffConstants;
+import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 import org.apache.commons.sanselan.formats.tiff.write.TiffOutputField;
 
 public class WriteTagsTest extends ExifBaseTest implements SanselanConstants
@@ -36,7 +37,7 @@ public class WriteTagsTest extends ExifB
     public void testSHORTS() throws Exception
     {
         TiffOutputField.create(
-            TiffConstants.TIFF_TAG_BITS_PER_SAMPLE,
+            TiffTagConstants.BITS_PER_SAMPLE.tagInfo,
             BinaryConstants.BYTE_ORDER_LITTLE_ENDIAN,
             new Integer[] { new Integer(1), new Integer(1) } );
     }



Mime
View raw message