commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1241569 [3/3] - in /commons/proper/sanselan/trunk/src: main/java/org/apache/commons/sanselan/formats/tiff/ main/java/org/apache/commons/sanselan/formats/tiff/constants/ main/java/org/apache/commons/sanselan/formats/tiff/datareaders/ main/j...
Date Tue, 07 Feb 2012 19:33:58 GMT
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/GpsTagConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/GpsTagConstants.java?rev=1241569&r1=1241568&r2=1241569&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/GpsTagConstants.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/GpsTagConstants.java Tue Feb  7 19:33:57 2012
@@ -27,153 +27,153 @@ public enum GpsTagConstants
 {
     GPS_VERSION_ID(new TagInfo(
             "GPS Version ID", 0x0000, FIELD_TYPE_DESCRIPTION_BYTE, 4,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_LATITUDE_REF(new TagInfo(
             "GPS Latitude Ref", 0x0001, FIELD_TYPE_DESCRIPTION_ASCII, 2,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_LATITUDE(new TagInfo(
             "GPS Latitude", 0x0002, FIELD_TYPE_DESCRIPTION_RATIONAL, 3,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_LONGITUDE_REF(new TagInfo(
             "GPS Longitude Ref", 0x0003, FIELD_TYPE_DESCRIPTION_ASCII, 2,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_LONGITUDE(new TagInfo(
             "GPS Longitude", 0x0004, FIELD_TYPE_DESCRIPTION_RATIONAL, 3,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_ALTITUDE_REF(new TagInfo(
             "GPS Altitude Ref", 0x0005, FIELD_TYPE_DESCRIPTION_BYTE, 1,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_ALTITUDE(new TagInfo(
             "GPS Altitude", 0x0006, FIELD_TYPE_DESCRIPTION_RATIONAL, 1,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_TIME_STAMP(new TagInfo(
             "GPS Time Stamp", 0x0007, FIELD_TYPE_DESCRIPTION_RATIONAL, 3,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_SATELLITES(new TagInfo(
             "GPS Satellites", 0x0008, FIELD_TYPE_DESCRIPTION_ASCII, -1,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_STATUS(new TagInfo("GPS Status",
-            0x0009, FIELD_TYPE_DESCRIPTION_ASCII, 2, EXIF_DIRECTORY_GPS)),
+            0x0009, FIELD_TYPE_DESCRIPTION_ASCII, 2, TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_MEASURE_MODE(new TagInfo(
             "GPS Measure Mode", 0x000a, FIELD_TYPE_DESCRIPTION_ASCII, 2,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_DOP(new TagInfo("GPS DOP",
-            0x000b, FIELD_TYPE_DESCRIPTION_RATIONAL, 1, EXIF_DIRECTORY_GPS)),
+            0x000b, FIELD_TYPE_DESCRIPTION_RATIONAL, 1, TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_SPEED_REF(new TagInfo(
             "GPS Speed Ref", 0x000c, FIELD_TYPE_DESCRIPTION_ASCII, 2,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_SPEED(new TagInfo("GPS Speed",
-            0x000d, FIELD_TYPE_DESCRIPTION_RATIONAL, 1, EXIF_DIRECTORY_GPS)),
+            0x000d, FIELD_TYPE_DESCRIPTION_RATIONAL, 1, TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_TRACK_REF(new TagInfo(
             "GPS Track Ref", 0x000e, FIELD_TYPE_DESCRIPTION_ASCII, 2,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_TRACK(new TagInfo("GPS Track",
-            0x000f, FIELD_TYPE_DESCRIPTION_RATIONAL, 1, EXIF_DIRECTORY_GPS)),
+            0x000f, FIELD_TYPE_DESCRIPTION_RATIONAL, 1, TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_IMG_DIRECTION_REF(new TagInfo(
             "GPS Img Direction Ref", 0x0010, FIELD_TYPE_DESCRIPTION_ASCII, 2,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_IMG_DIRECTION(new TagInfo(
             "GPS Img Direction", 0x0011, FIELD_TYPE_DESCRIPTION_RATIONAL, 1,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_MAP_DATUM(new TagInfo(
             "GPS Map Datum", 0x0012, FIELD_TYPE_DESCRIPTION_ASCII, -1,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_DEST_LATITUDE_REF(new TagInfo(
             "GPS Dest Latitude Ref", 0x0013, FIELD_TYPE_DESCRIPTION_ASCII, 2,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_DEST_LATITUDE(new TagInfo(
             "GPS Dest Latitude", 0x0014, FIELD_TYPE_DESCRIPTION_RATIONAL, 3,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_DEST_LONGITUDE_REF(new TagInfo(
             "GPS Dest Longitude Ref", 0x0015, FIELD_TYPE_DESCRIPTION_ASCII, 2,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_DEST_LONGITUDE(new TagInfo(
             "GPS Dest Longitude", 0x0016, FIELD_TYPE_DESCRIPTION_RATIONAL, 3,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_DEST_BEARING_REF(new TagInfo(
             "GPS Dest Bearing Ref", 0x0017, FIELD_TYPE_DESCRIPTION_ASCII, 2,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_DEST_BEARING(new TagInfo(
             "GPS Dest Bearing", 0x0018, FIELD_TYPE_DESCRIPTION_RATIONAL, 1,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_DEST_DISTANCE_REF(new TagInfo(
             "GPS Dest Distance Ref", 0x0019, FIELD_TYPE_DESCRIPTION_ASCII, 2,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_DEST_DISTANCE(new TagInfo(
             "GPS Dest Distance", 0x001a, FIELD_TYPE_DESCRIPTION_RATIONAL, 1,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_PROCESSING_METHOD(new TagInfo.Text(
             "GPS Processing Method", 0x001b, FIELD_TYPE_DESCRIPTION_UNKNOWN,
-            -1, EXIF_DIRECTORY_GPS)),
+            -1, TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_AREA_INFORMATION(new TagInfo.Text(
             "GPS Area Information", 0x001c, FIELD_TYPE_DESCRIPTION_UNKNOWN, -1,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_DATE_STAMP(new TagInfo(
             "GPS Date Stamp", 0x001d, FIELD_TYPE_DESCRIPTION_ASCII, 11,
-            EXIF_DIRECTORY_GPS)),
+            TiffDirectoryType.EXIF_DIRECTORY_GPS)),
 
     // ************************************************************
     GPS_DIFFERENTIAL(new TagInfo(
             "GPS Differential", 0x001e, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            EXIF_DIRECTORY_GPS));
+            TiffDirectoryType.EXIF_DIRECTORY_GPS));
     
     public final TagInfo tagInfo;
     

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TagConstantsUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TagConstantsUtils.java?rev=1241569&r1=1241568&r2=1241569&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TagConstantsUtils.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TagConstantsUtils.java Tue Feb  7 19:33:57 2012
@@ -21,6 +21,7 @@ import java.util.List;
 
 public class TagConstantsUtils implements TiffDirectoryConstants
 {
+    private static final TiffDirectoryType[] tiffDirectoryTypes = TiffDirectoryType.values();
 
     public static List<TagInfo> mergeTagLists(TagHolder[]... tagHolders)
     {
@@ -40,12 +41,13 @@ public class TagConstantsUtils implement
         return result;
     }
 
-    public static ExifDirectoryType getExifDirectoryType(int type)
+    public static TiffDirectoryType getExifDirectoryType(int type)
     {
-        for (int i = 0; i < EXIF_DIRECTORIES.length; i++)
-            if (EXIF_DIRECTORIES[i].directoryType == type)
-                return EXIF_DIRECTORIES[i];
-        return EXIF_DIRECTORY_UNKNOWN;
+        
+        for (int i = 0; i < tiffDirectoryTypes.length; i++)
+            if (tiffDirectoryTypes[i].directoryType == type)
+                return tiffDirectoryTypes[i];
+        return TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN;
     }
 
 }
\ No newline at end of file

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TagHolder.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TagHolder.java?rev=1241569&r1=1241568&r2=1241569&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TagHolder.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TagHolder.java Tue Feb  7 19:33:57 2012
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.commons.sanselan.formats.tiff.constants;
 
 public interface TagHolder {

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TagInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TagInfo.java?rev=1241569&r1=1241568&r2=1241569&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TagInfo.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TagInfo.java Tue Feb  7 19:33:57 2012
@@ -33,7 +33,7 @@ public class TagInfo implements TiffDire
     protected static final int LENGTH_UNKNOWN = -1;
 
     public TagInfo(String name, int tag, FieldType dataType, int length,
-            ExifDirectoryType exifDirectory)
+            TiffDirectoryType exifDirectory)
     {
         this(name, tag, new FieldType[]{
             dataType
@@ -44,7 +44,7 @@ public class TagInfo implements TiffDire
     {
         this(name, tag, new FieldType[]{
             dataType
-        }, length, EXIF_DIRECTORY_UNKNOWN);
+        }, length, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
     }
 
     public TagInfo(String name, int tag, FieldType dataType,
@@ -52,36 +52,36 @@ public class TagInfo implements TiffDire
     {
         this(name, tag, new FieldType[]{
             dataType
-        }, LENGTH_UNKNOWN, EXIF_DIRECTORY_UNKNOWN);
+        }, LENGTH_UNKNOWN, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
     }
 
     public TagInfo(String name, int tag, FieldType dataTypes[],
             String lengthDescription)
     {
-        this(name, tag, dataTypes, LENGTH_UNKNOWN, EXIF_DIRECTORY_UNKNOWN);
+        this(name, tag, dataTypes, LENGTH_UNKNOWN, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
     }
 
     public TagInfo(String name, int tag, FieldType dataType)
     {
-        this(name, tag, dataType, LENGTH_UNKNOWN, EXIF_DIRECTORY_UNKNOWN);
+        this(name, tag, dataType, LENGTH_UNKNOWN, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
     }
 
     public TagInfo(String name, int tag, FieldType dataTypes[], int length,
             String lengthDescription)
     {
-        this(name, tag, dataTypes, length, EXIF_DIRECTORY_UNKNOWN);
+        this(name, tag, dataTypes, length, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
     }
 
     public final String name;
     public final int tag;
     public final FieldType dataTypes[];
     public final int length;
-    public final ExifDirectoryType directoryType;
+    public final TiffDirectoryType directoryType;
 
     //    public final String lengthDescription;
 
     public TagInfo(String name, int tag, FieldType dataTypes[], int length,
-            ExifDirectoryType exifDirectory
+            TiffDirectoryType exifDirectory
     //            , String lengthDescription
     )
     {
@@ -139,13 +139,13 @@ public class TagInfo implements TiffDire
     public static class Offset extends TagInfo
     {
         public Offset(String name, int tag, FieldType dataTypes[], int length,
-                ExifDirectoryType exifDirectory)
+                TiffDirectoryType exifDirectory)
         {
             super(name, tag, dataTypes, length, exifDirectory);
         }
 
         public Offset(String name, int tag, FieldType dataType, int length,
-                ExifDirectoryType exifDirectory)
+                TiffDirectoryType exifDirectory)
         {
             super(name, tag, dataType, length, exifDirectory);
         }
@@ -234,13 +234,13 @@ public class TagInfo implements TiffDire
     public static final class Text extends TagInfo
     {
         public Text(String name, int tag, FieldType dataType, int length,
-                ExifDirectoryType exifDirectory)
+                TiffDirectoryType exifDirectory)
         {
             super(name, tag, dataType, length, exifDirectory);
         }
 
         public Text(String name, int tag, FieldType dataTypes[], int length,
-                ExifDirectoryType exifDirectory)
+                TiffDirectoryType exifDirectory)
         {
             super(name, tag, dataTypes, length, exifDirectory);
         }
@@ -414,7 +414,7 @@ public class TagInfo implements TiffDire
     {
 
         public Unknown(String name, int tag, FieldType dataTypes[], int length,
-                ExifDirectoryType exifDirectory)
+                TiffDirectoryType exifDirectory)
         {
             super(name, tag, dataTypes, length, exifDirectory);
         }

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffDirectoryConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffDirectoryConstants.java?rev=1241569&r1=1241568&r2=1241569&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffDirectoryConstants.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffDirectoryConstants.java Tue Feb  7 19:33:57 2012
@@ -18,7 +18,7 @@ package org.apache.commons.sanselan.form
 
 public interface TiffDirectoryConstants
 {
-
+    
     public static final int DIRECTORY_TYPE_UNKNOWN = -1;
     public static final int DIRECTORY_TYPE_ROOT = 0;
     public static final int DIRECTORY_TYPE_SUB = 1;
@@ -36,89 +36,4 @@ public interface TiffDirectoryConstants
     public static final int DIRECTORY_TYPE_DIR_2 = 2;
     public static final int DIRECTORY_TYPE_DIR_3 = 3;
     public static final int DIRECTORY_TYPE_DIR_4 = 4;
-
-    public abstract static class ExifDirectoryType
-    {
-        public final int directoryType;
-        public final String name;
-
-        public ExifDirectoryType(final int directoryType, final String name)
-        {
-            this.directoryType = directoryType;
-            this.name = name;
-        }
-
-        public abstract boolean isImageDirectory();
-
-        public static class Image extends ExifDirectoryType
-        {
-            public Image(final int directoryType, final String name)
-            {
-                super(directoryType, name);
-            }
-
-            public boolean isImageDirectory()
-            {
-                return true;
-            }
-        }
-
-        public static class Special extends ExifDirectoryType
-        {
-            public Special(final int directoryType, final String name)
-            {
-                super(directoryType, name);
-            }
-
-            public boolean isImageDirectory()
-            {
-                return false;
-            }
-        }
-
-    }
-
-    public static final ExifDirectoryType TIFF_DIRECTORY_IFD0 = new ExifDirectoryType.Image(
-            DIRECTORY_TYPE_DIR_0, "IFD0");
-    public static final ExifDirectoryType EXIF_DIRECTORY_IFD0 = TIFF_DIRECTORY_IFD0;
-    public static final ExifDirectoryType TIFF_DIRECTORY_ROOT = TIFF_DIRECTORY_IFD0;
-
-    public static final ExifDirectoryType TIFF_DIRECTORY_IFD1 = new ExifDirectoryType.Image(
-            DIRECTORY_TYPE_DIR_1, "IFD1");
-    public static final ExifDirectoryType EXIF_DIRECTORY_IFD1 = TIFF_DIRECTORY_IFD1;
-
-    public static final ExifDirectoryType TIFF_DIRECTORY_IFD2 = new ExifDirectoryType.Image(
-            DIRECTORY_TYPE_DIR_2, "IFD2");
-    public static final ExifDirectoryType EXIF_DIRECTORY_IFD2 = TIFF_DIRECTORY_IFD2;
-
-    public static final ExifDirectoryType TIFF_DIRECTORY_IFD3 = new ExifDirectoryType.Image(
-            DIRECTORY_TYPE_DIR_3, "IFD3");
-    public static final ExifDirectoryType EXIF_DIRECTORY_IFD3 = TIFF_DIRECTORY_IFD3;
-
-    public static final ExifDirectoryType EXIF_DIRECTORY_SUB_IFD = TIFF_DIRECTORY_IFD1;
-    public static final ExifDirectoryType EXIF_DIRECTORY_SUB_IFD1 = TIFF_DIRECTORY_IFD2;
-    public static final ExifDirectoryType EXIF_DIRECTORY_SUB_IFD2 = TIFF_DIRECTORY_IFD3;
-
-    public static final ExifDirectoryType EXIF_DIRECTORY_INTEROP_IFD = new ExifDirectoryType.Special(
-            DIRECTORY_TYPE_INTEROPERABILITY, "Interop IFD");
-    public static final ExifDirectoryType EXIF_DIRECTORY_MAKER_NOTES = new ExifDirectoryType.Special(
-            DIRECTORY_TYPE_MAKER_NOTES, "Maker Notes");
-    public static final ExifDirectoryType EXIF_DIRECTORY_EXIF_IFD = new ExifDirectoryType.Special(
-            DIRECTORY_TYPE_EXIF, "Exif IFD");
-    public static final ExifDirectoryType EXIF_DIRECTORY_GPS = new ExifDirectoryType.Special(
-            DIRECTORY_TYPE_GPS, "GPS IFD");
-
-    public static final ExifDirectoryType EXIF_DIRECTORY_UNKNOWN = null;
-
-    public static final ExifDirectoryType EXIF_DIRECTORIES[] = {
-            TIFF_DIRECTORY_ROOT, EXIF_DIRECTORY_EXIF_IFD, TIFF_DIRECTORY_IFD0,
-            EXIF_DIRECTORY_IFD0, TIFF_DIRECTORY_IFD1, EXIF_DIRECTORY_IFD1,
-            TIFF_DIRECTORY_IFD2, EXIF_DIRECTORY_IFD2,
-            EXIF_DIRECTORY_INTEROP_IFD, EXIF_DIRECTORY_MAKER_NOTES,
-            EXIF_DIRECTORY_SUB_IFD, EXIF_DIRECTORY_SUB_IFD1,
-            EXIF_DIRECTORY_SUB_IFD2,
-            //EXIF_DIRECTORY_UNKNOWN,
-            EXIF_DIRECTORY_GPS,
-    };
-
 }
\ No newline at end of file

Added: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffDirectoryType.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffDirectoryType.java?rev=1241569&view=auto
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffDirectoryType.java (added)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffDirectoryType.java Tue Feb  7 19:33:57 2012
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.sanselan.formats.tiff.constants;
+
+public enum TiffDirectoryType {
+    TIFF_DIRECTORY_IFD0(
+            true, TiffDirectoryConstants.DIRECTORY_TYPE_DIR_0, "IFD0"),
+
+    TIFF_DIRECTORY_IFD1(
+            true, TiffDirectoryConstants.DIRECTORY_TYPE_DIR_1, "IFD1"),
+    
+    TIFF_DIRECTORY_IFD2(
+            true, TiffDirectoryConstants.DIRECTORY_TYPE_DIR_2, "IFD2"),
+
+    TIFF_DIRECTORY_IFD3(
+            true, TiffDirectoryConstants.DIRECTORY_TYPE_DIR_3, "IFD3"),
+
+    EXIF_DIRECTORY_INTEROP_IFD(
+            false, TiffDirectoryConstants.DIRECTORY_TYPE_INTEROPERABILITY, "Interop IFD"),
+    EXIF_DIRECTORY_MAKER_NOTES(
+            false, TiffDirectoryConstants.DIRECTORY_TYPE_MAKER_NOTES, "Maker Notes"),
+    EXIF_DIRECTORY_EXIF_IFD(
+            false, TiffDirectoryConstants.DIRECTORY_TYPE_EXIF, "Exif IFD"),
+    EXIF_DIRECTORY_GPS(
+            false, TiffDirectoryConstants.DIRECTORY_TYPE_GPS, "GPS IFD");
+    
+    private final boolean isImageDirectory;
+    public final int directoryType;
+    public final String name;
+    
+    TiffDirectoryType(final boolean isImageDirectory, final int directoryType, final String name) {
+        this.isImageDirectory = isImageDirectory;
+        this.directoryType = directoryType;
+        this.name = name;
+    }
+    
+    public boolean isImageDirectory() {
+        return isImageDirectory;
+    }
+
+    public static final TiffDirectoryType EXIF_DIRECTORY_IFD0 = TIFF_DIRECTORY_IFD0;
+    public static final TiffDirectoryType TIFF_DIRECTORY_ROOT = TIFF_DIRECTORY_IFD0;
+    public static final TiffDirectoryType EXIF_DIRECTORY_IFD1 = TIFF_DIRECTORY_IFD1;
+    public static final TiffDirectoryType EXIF_DIRECTORY_IFD2 = TIFF_DIRECTORY_IFD2;
+    public static final TiffDirectoryType EXIF_DIRECTORY_IFD3 = TIFF_DIRECTORY_IFD3;
+    public static final TiffDirectoryType EXIF_DIRECTORY_SUB_IFD = TIFF_DIRECTORY_IFD1;
+    public static final TiffDirectoryType EXIF_DIRECTORY_SUB_IFD1 = TIFF_DIRECTORY_IFD2;
+    public static final TiffDirectoryType EXIF_DIRECTORY_SUB_IFD2 = TIFF_DIRECTORY_IFD3;
+    public static final TiffDirectoryType EXIF_DIRECTORY_UNKNOWN = null;
+}

Propchange: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffDirectoryType.java
------------------------------------------------------------------------------
    svn:eol-style = native

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=1241569&r1=1241568&r2=1241569&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 Tue Feb  7 19:33:57 2012
@@ -19,294 +19,294 @@ package org.apache.commons.sanselan.form
 import java.util.Collections;
 import java.util.List;
 
-public enum TiffTagConstants implements TiffFieldTypeConstants, TiffDirectoryConstants, TagHolder
+public enum TiffTagConstants implements TiffFieldTypeConstants, TagHolder
 {
 
     NEW_SUBFILE_TYPE(new TagInfo(
             "New Subfile Type", 0xFE, FIELD_TYPE_DESCRIPTION_LONG, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     SUBFILE_TYPE(new TagInfo(
             "Subfile Type", 0xFF, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     IMAGE_WIDTH(new TagInfo(
             "Image Width", 0x100, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     IMAGE_LENGTH(new TagInfo(
             "Image Length", 0x101, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     BITS_PER_SAMPLE(new TagInfo(
             "Bits Per Sample", 0x102, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     COMPRESSION(new TagInfo(
             "Compression", 0x103, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     PHOTOMETRIC_INTERPRETATION(new TagInfo(
             "Photometric Interpretation", 0x106, FIELD_TYPE_DESCRIPTION_SHORT,
-            1, TIFF_DIRECTORY_ROOT)),
+            1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     THRESHHOLDING(new TagInfo(
             "Threshholding", 0x107, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     CELL_WIDTH(new TagInfo("Cell Width",
-            0x108, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT)),
+            0x108, FIELD_TYPE_DESCRIPTION_SHORT, 1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     CELL_LENGTH(new TagInfo(
             "Cell Length", 0x109, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     FILL_ORDER(new TagInfo("Fill Order",
-            0x10A, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT)),
+            0x10A, FIELD_TYPE_DESCRIPTION_SHORT, 1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     DOCUMENT_NAME(new TagInfo(
             "Document Name", 0x10D, FIELD_TYPE_DESCRIPTION_ASCII, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     IMAGE_DESCRIPTION(new TagInfo(
             "Image Description", 0x10E, FIELD_TYPE_DESCRIPTION_ASCII, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     MAKE(new TagInfo("Make", 0x10F,
-            FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
+            FIELD_TYPE_DESCRIPTION_ASCII, -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     MODEL(new TagInfo("Model", 0x110,
-            FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
+            FIELD_TYPE_DESCRIPTION_ASCII, -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     STRIP_OFFSETS(new TagInfo.Offset(
             "Strip Offsets", 0x111, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     ORIENTATION(new TagInfo(
             "Orientation", 0x112, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     SAMPLES_PER_PIXEL(new TagInfo(
             "Samples Per Pixel", 0x115, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     ROWS_PER_STRIP(new TagInfo(
             "Rows Per Strip", 0x116, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     STRIP_BYTE_COUNTS(new TagInfo(
             "Strip Byte Counts", 0x117, FIELD_TYPE_DESCRIPTION_LONG_OR_SHORT,
-            -1, TIFF_DIRECTORY_ROOT)),
+            -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     MIN_SAMPLE_VALUE(new TagInfo(
             "Min Sample Value", 0x118, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     MAX_SAMPLE_VALUE(new TagInfo(
             "Max Sample Value", 0x119, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     XRESOLUTION(new TagInfo(
             "XResolution", 0x11A, FIELD_TYPE_DESCRIPTION_RATIONAL, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     YRESOLUTION(new TagInfo(
             "YResolution", 0x11B, FIELD_TYPE_DESCRIPTION_RATIONAL, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     PLANAR_CONFIGURATION(new TagInfo(
             "Planar Configuration", 0x11C, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     PAGE_NAME(new TagInfo("Page Name",
-            0x11D, FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
+            0x11D, FIELD_TYPE_DESCRIPTION_ASCII, -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     XPOSITION(new TagInfo("XPosition",
-            0x11E, FIELD_TYPE_DESCRIPTION_RATIONAL, -1, TIFF_DIRECTORY_ROOT)),
+            0x11E, FIELD_TYPE_DESCRIPTION_RATIONAL, -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     YPOSITION(new TagInfo("YPosition",
-            0x11F, FIELD_TYPE_DESCRIPTION_RATIONAL, -1, TIFF_DIRECTORY_ROOT)),
+            0x11F, FIELD_TYPE_DESCRIPTION_RATIONAL, -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     FREE_OFFSETS(new TagInfo(
             "Free Offsets", 0x120, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     FREE_BYTE_COUNTS(new TagInfo(
             "Free Byte Counts", 0x121, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     GRAY_RESPONSE_UNIT(new TagInfo(
             "Gray Response Unit", 0x122, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     GRAY_RESPONSE_CURVE(new TagInfo(
             "Gray Response Curve", 0x123, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     T4_OPTIONS(new TagInfo("T4 Options",
-            0x124, FIELD_TYPE_DESCRIPTION_LONG, 1, TIFF_DIRECTORY_ROOT)),
+            0x124, FIELD_TYPE_DESCRIPTION_LONG, 1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     T6_OPTIONS(new TagInfo("T6 Options",
-            0x125, FIELD_TYPE_DESCRIPTION_LONG, 1, TIFF_DIRECTORY_ROOT)),
+            0x125, FIELD_TYPE_DESCRIPTION_LONG, 1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     RESOLUTION_UNIT(new TagInfo(
             "Resolution Unit", 0x128, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     PAGE_NUMBER(new TagInfo(
             "Page Number", 0x129, FIELD_TYPE_DESCRIPTION_SHORT, 2,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     TRANSFER_FUNCTION(new TagInfo(
             "Transfer Function", 0x12D, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     SOFTWARE(new TagInfo("Software",
-            0x131, FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
+            0x131, FIELD_TYPE_DESCRIPTION_ASCII, -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     DATE_TIME(new TagInfo("Date Time",
-            0x132, FIELD_TYPE_DESCRIPTION_ASCII, 20, TIFF_DIRECTORY_ROOT)),
+            0x132, FIELD_TYPE_DESCRIPTION_ASCII, 20, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     ARTIST(new TagInfo("Artist", 0x13B,
-            FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
+            FIELD_TYPE_DESCRIPTION_ASCII, -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     HOST_COMPUTER(new TagInfo(
             "Host Computer", 0x13C, FIELD_TYPE_DESCRIPTION_ASCII, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     PREDICTOR(new TagInfo("Predictor",
-            0x13D, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT)),
+            0x13D, FIELD_TYPE_DESCRIPTION_SHORT, 1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     WHITE_POINT(new TagInfo(
             "White Point", 0x13E, FIELD_TYPE_DESCRIPTION_RATIONAL, 2,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     PRIMARY_CHROMATICITIES(new TagInfo(
             "Primary Chromaticities", 0x13F, FIELD_TYPE_DESCRIPTION_RATIONAL,
-            6, TIFF_DIRECTORY_ROOT)),
+            6, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     COLOR_MAP(new TagInfo("Color Map",
-            0x140, FIELD_TYPE_DESCRIPTION_SHORT, -1, TIFF_DIRECTORY_ROOT)),
+            0x140, FIELD_TYPE_DESCRIPTION_SHORT, -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     HALFTONE_HINTS(new TagInfo(
             "Halftone Hints", 0x141, FIELD_TYPE_DESCRIPTION_SHORT, 2,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     TILE_WIDTH(new TagInfo("Tile Width",
-            0x142, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, 1, TIFF_DIRECTORY_ROOT)),
+            0x142, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, 1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     TILE_LENGTH(new TagInfo(
             "Tile Length", 0x143, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     TILE_OFFSETS(new TagInfo.Offset(
             "Tile Offsets", 0x144, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     TILE_BYTE_COUNTS(new TagInfo(
             "Tile Byte Counts", 0x145, FIELD_TYPE_DESCRIPTION_SHORT_OR_LONG,
-            -1, TIFF_DIRECTORY_ROOT)),
+            -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     INK_SET(new TagInfo("Ink Set",
-            0x14C, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT)),
+            0x14C, FIELD_TYPE_DESCRIPTION_SHORT, 1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     INK_NAMES(new TagInfo("Ink Names",
-            0x14D, FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
+            0x14D, FIELD_TYPE_DESCRIPTION_ASCII, -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     NUMBER_OF_INKS(new TagInfo(
             "Number Of Inks", 0x14E, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     DOT_RANGE(new TagInfo("Dot Range",
             0x150, FIELD_TYPE_DESCRIPTION_BYTE_OR_SHORT, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     TARGET_PRINTER(new TagInfo(
             "Target Printer", 0x151, FIELD_TYPE_DESCRIPTION_ASCII, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     EXTRA_SAMPLES(new TagInfo(
             "Extra Samples", 0x152, FIELD_TYPE_DESCRIPTION_BYTE, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     SAMPLE_FORMAT(new TagInfo(
             "Sample Format", 0x153, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     SMIN_SAMPLE_VALUE(new TagInfo(
             "SMin Sample Value", 0x154, FIELD_TYPE_DESCRIPTION_ANY, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     SMAX_SAMPLE_VALUE(new TagInfo(
             "SMax Sample Value", 0x155, FIELD_TYPE_DESCRIPTION_ANY, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     TRANSFER_RANGE(new TagInfo(
             "Transfer Range", 0x156, FIELD_TYPE_DESCRIPTION_SHORT, 6,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     JPEG_PROC(new TagInfo("JPEGProc",
-            0x200, FIELD_TYPE_DESCRIPTION_SHORT, 1, TIFF_DIRECTORY_ROOT)),
+            0x200, FIELD_TYPE_DESCRIPTION_SHORT, 1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     JPEG_INTERCHANGE_FORMAT(new TagInfo.Offset(
             "JPEGInterchange Format", 0x201, FIELD_TYPE_DESCRIPTION_LONG, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     JPEG_INTERCHANGE_FORMAT_LENGTH(new TagInfo(
             "JPEGInterchange Format Length", 0x202,
-            FIELD_TYPE_DESCRIPTION_LONG, 1, TIFF_DIRECTORY_ROOT)),
+            FIELD_TYPE_DESCRIPTION_LONG, 1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     JPEG_RESTART_INTERVAL(new TagInfo(
             "JPEGRestart Interval", 0x203, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     JPEG_LOSSLESS_PREDICTORS(new TagInfo(
             "JPEGLossless Predictors", 0x205, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     JPEG_POINT_TRANSFORMS(new TagInfo(
             "JPEGPoint Transforms", 0x206, FIELD_TYPE_DESCRIPTION_SHORT, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     JPEG_QTABLES(new TagInfo(
             "JPEGQTables", 0x207, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     JPEG_DCTABLES(new TagInfo(
             "JPEGDCTables", 0x208, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     JPEG_ACTABLES(new TagInfo(
             "JPEGACTables", 0x209, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     YCBCR_COEFFICIENTS(new TagInfo(
             "YCbCr Coefficients", 0x211, FIELD_TYPE_DESCRIPTION_RATIONAL, 3,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     YCBCR_SUB_SAMPLING(new TagInfo(
             "YCbCr Sub Sampling", 0x212, FIELD_TYPE_DESCRIPTION_SHORT, 2,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     YCBCR_POSITIONING(new TagInfo(
             "YCbCr Positioning", 0x213, FIELD_TYPE_DESCRIPTION_SHORT, 1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     REFERENCE_BLACK_WHITE(new TagInfo(
             "Reference Black White", 0x214, FIELD_TYPE_DESCRIPTION_LONG, -1,
-            TIFF_DIRECTORY_ROOT)),
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     COPYRIGHT(new TagInfo("Copyright",
-            0x8298, FIELD_TYPE_DESCRIPTION_ASCII, -1, TIFF_DIRECTORY_ROOT)),
+            0x8298, FIELD_TYPE_DESCRIPTION_ASCII, -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     XMP(new TagInfo("XMP",
-            0x2BC, FIELD_TYPE_DESCRIPTION_BYTE, -1, TIFF_DIRECTORY_ROOT)),
+            0x2BC, FIELD_TYPE_DESCRIPTION_BYTE, -1, TiffDirectoryType.TIFF_DIRECTORY_ROOT)),
 
     // TODO:
     //    public static final TagInfo2 UNKNOWN(null;
     UNKNOWN(new TagInfo.Unknown(
             "Unknown Tag", -1, FIELD_TYPE_DESCRIPTION_UNKNOWN,
-            TagInfo.LENGTH_UNKNOWN, EXIF_DIRECTORY_UNKNOWN));
+            TagInfo.LENGTH_UNKNOWN, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN));
     
     public final TagInfo tagInfo;
     

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=1241569&r1=1241568&r2=1241569&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 Tue Feb  7 19:33:57 2012
@@ -29,6 +29,7 @@ import org.apache.commons.sanselan.commo
 import org.apache.commons.sanselan.common.mylzw.MyLzwDecompressor;
 import org.apache.commons.sanselan.formats.tiff.TiffDirectory;
 import org.apache.commons.sanselan.formats.tiff.TiffField;
+import org.apache.commons.sanselan.formats.tiff.constants.ExifTagConstants;
 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;
@@ -111,13 +112,13 @@ public abstract class DataReader impleme
             int expected_size, int tileWidth, int tileHeight) throws ImageReadException, IOException
     {
         TiffField fillOrderField = directory.findField(TiffTagConstants.FILL_ORDER.tagInfo);
-        int fillOrder = 1;
+        int fillOrder = ExifTagConstants.FILL_ORDER_VALUE_NORMAL;
         if (fillOrderField != null) {
             fillOrder = fillOrderField.getIntValue();
         }
-        if (fillOrder == 1) {
+        if (fillOrder == ExifTagConstants.FILL_ORDER_VALUE_NORMAL) {
             // good
-        } else if (fillOrder == 2) {
+        } else if (fillOrder == ExifTagConstants.FILL_ORDER_VALUE_REVERSED) {
             for (int i = 0; i < compressed.length; i++) {
                 compressed[i] = (byte) (Integer.reverse(0xff & compressed[i]) >>> 24);
             }

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=1241569&r1=1241568&r2=1241569&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 Tue Feb  7 19:33:57 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.TiffDirectoryType;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 import org.apache.commons.sanselan.formats.tiff.fieldtypes.FieldType;
 
@@ -174,7 +175,7 @@ public final class TiffOutputDirectory e
 
     public String getItemDescription()
     {
-        ExifDirectoryType dirType = TagConstantsUtils
+        TiffDirectoryType dirType = TagConstantsUtils
                 .getExifDirectoryType(type);
         return "Directory: " + dirType.name + " (" + type + ")";
     }

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/icc/IccTagDataTypes.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/icc/IccTagDataTypes.java?rev=1241569&r1=1241568&r2=1241569&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/icc/IccTagDataTypes.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/icc/IccTagDataTypes.java Tue Feb  7 19:33:57 2012
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.commons.sanselan.icc;
 
 import java.io.ByteArrayInputStream;

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/icc/IccTagTypes.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/icc/IccTagTypes.java?rev=1241569&r1=1241568&r2=1241569&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/icc/IccTagTypes.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/icc/IccTagTypes.java Tue Feb  7 19:33:57 2012
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.commons.sanselan.icc;
 
 public enum IccTagTypes implements IccTagType {

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/TextFieldTest.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/TextFieldTest.java?rev=1241569&r1=1241568&r2=1241569&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/TextFieldTest.java (original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/TextFieldTest.java Tue Feb  7 19:33:57 2012
@@ -25,7 +25,7 @@ import org.apache.commons.sanselan.Image
 import org.apache.commons.sanselan.formats.tiff.TiffField;
 import org.apache.commons.sanselan.formats.tiff.constants.ExifTagConstants;
 import org.apache.commons.sanselan.formats.tiff.constants.GpsTagConstants;
-import org.apache.commons.sanselan.formats.tiff.constants.TiffDirectoryConstants;
+import org.apache.commons.sanselan.formats.tiff.constants.TiffDirectoryType;
 import org.apache.commons.sanselan.util.Debug;
 
 public class TextFieldTest extends SpecificExifTagTest
@@ -41,10 +41,10 @@ public class TextFieldTest extends Speci
         if (field.tag == ExifTagConstants.USER_COMMENT.tagInfo.tag)
         { /* do nothing */ }
         else if (field.tag == GpsTagConstants.GPS_PROCESSING_METHOD.tagInfo.tag
-                && field.directoryType == TiffDirectoryConstants.EXIF_DIRECTORY_GPS.directoryType)
+                && field.directoryType == TiffDirectoryType.EXIF_DIRECTORY_GPS.directoryType)
         { /* do nothing */ }
         else if (field.tag == GpsTagConstants.GPS_AREA_INFORMATION.tagInfo.tag
-                && field.directoryType == TiffDirectoryConstants.EXIF_DIRECTORY_GPS.directoryType)
+                && field.directoryType == TiffDirectoryType.EXIF_DIRECTORY_GPS.directoryType)
         { /* do nothing */ }
         else
             return;



Mime
View raw message