commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1302095 - in /commons/proper/sanselan/trunk/src: main/java/org/apache/commons/sanselan/formats/tiff/constants/ test/java/org/apache/commons/sanselan/formats/tiff/
Date Sun, 18 Mar 2012 08:34:38 GMT
Author: damjan
Date: Sun Mar 18 08:34:37 2012
New Revision: 1302095

URL: http://svn.apache.org/viewvc?rev=1302095&view=rev
Log:
Factor out more TIFF tags into separate classes.


Added:
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/AdobePageMaker6TagConstants.java
  (with props)
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffClassFTagConstants.java
  (with props)
Modified:
    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/ExifTagConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffTagConstants.java
    commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/tiff/TiffTagIntegrityTest.java

Added: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/AdobePageMaker6TagConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/AdobePageMaker6TagConstants.java?rev=1302095&view=auto
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/AdobePageMaker6TagConstants.java
(added)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/AdobePageMaker6TagConstants.java
Sun Mar 18 08:34:37 2012
@@ -0,0 +1,62 @@
+package org.apache.commons.sanselan.formats.tiff.constants;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfo;
+import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfoAscii;
+import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfoByte;
+import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfoLong;
+import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfoShort;
+
+/**
+ * TIFF specification supplement 1
+ * <BR>
+ * Enhancements for Adobe PageMaker(R) 6.0 software
+ * <BR>
+ * http://partners.adobe.com/public/developer/en/tiff/TIFFPM6.pdf
+ */
+public interface AdobePageMaker6TagConstants extends TiffFieldTypeConstants {
+    public static final TagInfoLong TIFF_TAG_SUB_IFD = new TagInfoLong(
+            "Sub IFD",  0x014a, -1,
+            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN, true);
+
+    public static final TagInfoByte TIFF_TAG_CLIP_PATH = new TagInfoByte(
+            "Clip Path",  0x0157, -1,
+            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
+    
+    public static final TagInfoLong TIFF_TAG_XCLIP_PATH_UNITS = new TagInfoLong(
+            "XClip Path Units", 0x0158, 1,
+            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
+    
+    public static final TagInfoLong TIFF_TAG_YCLIP_PATH_UNITS = new TagInfoLong(
+            "YClip Path Units", 0x0159, 1,
+            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
+
+    public static final TagInfoShort TIFF_TAG_INDEXED = new TagInfoShort(
+            "Indexed", 0x015a, 1,
+            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
+    public static final int INDEXED_VALUE_NOT_INDEXED = 0;
+    public static final int INDEXED_VALUE_INDEXED = 1;
+
+    public static final TagInfoShort TIFF_TAG_OPIPROXY = new TagInfoShort(
+            "OPIProxy", 0x015f, 1,
+            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
+    public static final int OPIPROXY_VALUE_HIGHER_RESOLUTION_IMAGE_DOES_NOT_EXIST = 0;
+    public static final int OPIPROXY_VALUE_HIGHER_RESOLUTION_IMAGE_EXISTS = 1;
+
+    public static final TagInfoAscii TIFF_TAG_IMAGE_ID = new TagInfoAscii(
+            "Image ID", 0x800d, -1,
+            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
+    
+    public static final List<TagInfo> ALL_ADOBE_PAGEMAKER_6_TAG_CONSTANTS =
+            Collections.unmodifiableList(Arrays.asList(
+                    TIFF_TAG_SUB_IFD,
+                    TIFF_TAG_CLIP_PATH,
+                    TIFF_TAG_XCLIP_PATH_UNITS,
+                    TIFF_TAG_YCLIP_PATH_UNITS,
+                    TIFF_TAG_INDEXED,
+                    TIFF_TAG_OPIPROXY,
+                    TIFF_TAG_IMAGE_ID));
+}

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

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=1302095&r1=1302094&r2=1302095&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
Sun Mar 18 08:34:37 2012
@@ -28,6 +28,9 @@ public interface AllTagConstants
 {
     public static final List<TagInfo> ALL_TAGS = Collections.unmodifiableList(
             TagConstantsUtils.mergeTagLists(TiffTagConstants.ALL_TIFF_TAGS,
-                    GpsTagConstants.ALL_GPS_TAGS, ExifTagConstants.ALL_EXIF_TAGS));
+                    ExifTagConstants.ALL_EXIF_TAGS,
+                    TiffClassFTagConstants.ALL_TIFF_CLASS_F_TAGS,
+                    AdobePageMaker6TagConstants.ALL_ADOBE_PAGEMAKER_6_TAG_CONSTANTS,
+                    GpsTagConstants.ALL_GPS_TAGS));
 
 }
\ No newline at end of file

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/ExifTagConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/ExifTagConstants.java?rev=1302095&r1=1302094&r2=1302095&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/ExifTagConstants.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/ExifTagConstants.java
Sun Mar 18 08:34:37 2012
@@ -46,7 +46,6 @@ import org.apache.commons.sanselan.forma
  * http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html
  * http://tiki-lounge.com/~raf/tiff/fields.html
  * http://www.awaresystems.be/imaging/tiff/tifftags.html
- * http://cool.conservation-us.org/bytopic/imaging/std/tiff-f.html
  * 
  * DNG: http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/products/photoshop/pdfs/dng_spec.pdf
  * 
@@ -87,38 +86,8 @@ public interface ExifTagConstants
     public static final TagInfoShort EXIF_TAG_COLOR_RESPONSE_UNIT = new TagInfoShort(
             "Color Response Unit", 0x012c, 1,
             TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
-    public static final TagInfoShortOrLong EXIF_TAG_BAD_FAX_LINES = new TagInfoShortOrLong(
-            "Bad Fax Lines", 0x0146, 1,
-            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
-    public static final TagInfoShort EXIF_TAG_CLEAN_FAX_DATA = new TagInfoShort(
-            "Clean Fax Data", 0x0147, 1,
-            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
-    public static final int CLEAN_FAX_DATA_VALUE_CLEAN = 0;
-    public static final int CLEAN_FAX_DATA_VALUE_REGENERATED = 1;
-    public static final int CLEAN_FAX_DATA_VALUE_UNCLEAN = 2;
-    public static final TagInfoShortOrLong EXIF_TAG_CONSECUTIVE_BAD_FAX_LINES = new TagInfoShortOrLong(
-            "Consecutive Bad Fax Lines", 0x0148,
-            1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
-    public static final TagInfoLong EXIF_TAG_SUB_IFD = new TagInfoLong("Sub IFD",
-            0x014a, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN, true);
-    public static final TagInfoByte EXIF_TAG_CLIP_PATH = new TagInfoByte("Clip Path",
-            0x0157, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
-    public static final TagInfoLong EXIF_TAG_XCLIP_PATH_UNITS = new TagInfoLong(
-            "XClip Path Units", 0x0158, 1,
-            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
-    public static final TagInfoLong EXIF_TAG_YCLIP_PATH_UNITS = new TagInfoLong(
-            "YClip Path Units", 0x0159, 1,
-            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
-    public static final TagInfoShort EXIF_TAG_INDEXED = new TagInfoShort("Indexed",
-            0x015a, 1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
-    public static final int INDEXED_VALUE_NOT_INDEXED = 0;
-    public static final int INDEXED_VALUE_INDEXED = 1;
     public static final TagInfoUndefined EXIF_TAG_JPEGTABLES = new TagInfoUndefined("JPEGTables",
             0x015b, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
-    public static final TagInfoShort EXIF_TAG_OPIPROXY = new TagInfoShort("OPIProxy",
-            0x015f, 1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
-    public static final int OPIPROXY_VALUE_HIGHER_RESOLUTION_IMAGE_DOES_NOT_EXIST = 0;
-    public static final int OPIPROXY_VALUE_HIGHER_RESOLUTION_IMAGE_EXISTS = 1;
     public static final TagInfoLong EXIF_TAG_GLOBAL_PARAMETERS_IFD = new TagInfoLong(
             "Global Parameters IFD", 0x0190, 1,
             TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN, true);
@@ -194,8 +163,6 @@ public interface ExifTagConstants
             1, TiffDirectoryType.EXIF_DIRECTORY_IFD0);
     public static final TagInfoShort EXIF_TAG_RATING_PERCENT = new TagInfoShort(
             "Rating Percent", 0x4749, 1, TiffDirectoryType.EXIF_DIRECTORY_IFD0);
-    public static final TagInfoAscii EXIF_TAG_IMAGE_ID = new TagInfoAscii("Image ID",
-            0x800d, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
     public static final TagInfoByte EXIF_TAG_WANG_ANNOTATION = new TagInfoByte(
             "Wang Annotation", 0x80a4, -1,
             TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
@@ -1084,11 +1051,7 @@ public interface ExifTagConstants
                     EXIF_TAG_PREVIEW_IMAGE_LENGTH_SUB_IFD1,
                     EXIF_TAG_JPG_FROM_RAW_LENGTH_SUB_IFD2,
                     EXIF_TAG_COLOR_RESPONSE_UNIT,
-                    EXIF_TAG_BAD_FAX_LINES, EXIF_TAG_CLEAN_FAX_DATA,
-                    EXIF_TAG_CONSECUTIVE_BAD_FAX_LINES, EXIF_TAG_SUB_IFD,
-                    EXIF_TAG_CLIP_PATH,
-                    EXIF_TAG_XCLIP_PATH_UNITS, EXIF_TAG_YCLIP_PATH_UNITS,
-                    EXIF_TAG_INDEXED, EXIF_TAG_JPEGTABLES, EXIF_TAG_OPIPROXY,
+                    EXIF_TAG_JPEGTABLES,
                     EXIF_TAG_GLOBAL_PARAMETERS_IFD, EXIF_TAG_PROFILE_TYPE,
                     EXIF_TAG_FAX_PROFILE, EXIF_TAG_CODING_METHODS,
                     EXIF_TAG_VERSION_YEAR, EXIF_TAG_MODE_NUMBER, EXIF_TAG_DECODE,
@@ -1102,7 +1065,7 @@ public interface ExifTagConstants
                     EXIF_TAG_STRIP_ROW_COUNTS, EXIF_TAG_APPLICATION_NOTES,
                     EXIF_TAG_RELATED_IMAGE_FILE_FORMAT, EXIF_TAG_RELATED_IMAGE_WIDTH,
                     EXIF_TAG_RELATED_IMAGE_LENGTH, EXIF_TAG_RATING,
-                    EXIF_TAG_RATING_PERCENT, EXIF_TAG_IMAGE_ID,
+                    EXIF_TAG_RATING_PERCENT,
                     EXIF_TAG_WANG_ANNOTATION, EXIF_TAG_MATTEING, EXIF_TAG_DATA_TYPE,
                     EXIF_TAG_IMAGE_DEPTH, EXIF_TAG_TILE_DEPTH, EXIF_TAG_MODEL_2,
                     EXIF_TAG_CFAREPEAT_PATTERN_DIM, EXIF_TAG_CFAPATTERN_2,

Added: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffClassFTagConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffClassFTagConstants.java?rev=1302095&view=auto
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffClassFTagConstants.java
(added)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffClassFTagConstants.java
Sun Mar 18 08:34:37 2012
@@ -0,0 +1,35 @@
+package org.apache.commons.sanselan.formats.tiff.constants;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfo;
+import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfoShort;
+import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfoShortOrLong;
+
+/**
+ * "The spirit of TIFF class F"
+ * http://cool.conservation-us.org/bytopic/imaging/std/tiff-f.html
+ */
+public interface TiffClassFTagConstants extends TiffFieldTypeConstants {
+    public static final TagInfoShortOrLong TIFF_TAG_BAD_FAX_LINES = new TagInfoShortOrLong(
+            "Bad Fax Lines", 0x0146, 1,
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT);
+    
+    public static final TagInfoShort TIFF_TAG_CLEAN_FAX_DATA = new TagInfoShort(
+            "Clean Fax Data", 0x0147, 1,
+            TiffDirectoryType.TIFF_DIRECTORY_ROOT);
+    public static final int CLEAN_FAX_DATA_VALUE_CLEAN = 0;
+    public static final int CLEAN_FAX_DATA_VALUE_REGENERATED = 1;
+    public static final int CLEAN_FAX_DATA_VALUE_UNCLEAN = 2;
+    
+    public static final TagInfoShortOrLong TIFF_TAG_CONSECUTIVE_BAD_FAX_LINES = new TagInfoShortOrLong(
+            "Consecutive Bad Fax Lines", 0x0148,
+            1, TiffDirectoryType.TIFF_DIRECTORY_ROOT);
+
+    public static final List<TagInfo> ALL_TIFF_CLASS_F_TAGS =
+            Collections.unmodifiableList(Arrays.asList(
+                    TIFF_TAG_BAD_FAX_LINES, TIFF_TAG_CLEAN_FAX_DATA,
+                    TIFF_TAG_CONSECUTIVE_BAD_FAX_LINES));
+}

Propchange: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffClassFTagConstants.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=1302095&r1=1302094&r2=1302095&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
Sun Mar 18 08:34:37 2012
@@ -38,7 +38,6 @@ public interface TiffTagConstants
         extends
             TiffFieldTypeConstants
 {
-
     public static final TagInfoLong TIFF_TAG_NEW_SUBFILE_TYPE = new TagInfoLong(
             "New Subfile Type", 0xFE, 1,
             TiffDirectoryType.TIFF_DIRECTORY_ROOT);

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/tiff/TiffTagIntegrityTest.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/tiff/TiffTagIntegrityTest.java?rev=1302095&r1=1302094&r2=1302095&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/tiff/TiffTagIntegrityTest.java
(original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/tiff/TiffTagIntegrityTest.java
Sun Mar 18 08:34:37 2012
@@ -20,8 +20,10 @@ import java.lang.reflect.Field;
 import java.util.List;
 
 import org.apache.commons.sanselan.SanselanTest;
+import org.apache.commons.sanselan.formats.tiff.constants.AdobePageMaker6TagConstants;
 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.TiffClassFTagConstants;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfo;
 
@@ -30,6 +32,8 @@ public class TiffTagIntegrityTest extend
         verifyFields(TiffTagConstants.class, TiffTagConstants.ALL_TIFF_TAGS);
         verifyFields(GpsTagConstants.class, GpsTagConstants.ALL_GPS_TAGS);
         verifyFields(ExifTagConstants.class, ExifTagConstants.ALL_EXIF_TAGS);
+        verifyFields(TiffClassFTagConstants.class, TiffClassFTagConstants.ALL_TIFF_CLASS_F_TAGS);
+        verifyFields(AdobePageMaker6TagConstants.class, AdobePageMaker6TagConstants.ALL_ADOBE_PAGEMAKER_6_TAG_CONSTANTS);
     }
     
     private void verifyFields(Class<?> cls, List<TagInfo> tags) {



Mime
View raw message