Author: damjan Date: Sun Mar 18 09:25:59 2012 New Revision: 1302103 URL: http://svn.apache.org/viewvc?rev=1302103&view=rev Log: Factor out RFC 2301 tags and TIFF4 tags.
Added: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/Rfc2301TagConstants.java (with props) commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/Tiff4TagConstants.java (with props) Removed: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/TiffClassFTagConstants.java 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 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=1302103&r1=1302102&r2=1302103&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 09:25:59 2012 @@ -27,9 +27,11 @@ public interface AllTagConstants SanselanConstants { public static final List<TagInfo> ALL_TAGS = Collections.unmodifiableList( - TagConstantsUtils.mergeTagLists(TiffTagConstants.ALL_TIFF_TAGS, + TagConstantsUtils.mergeTagLists( + Tiff4TagConstants.ALL_TIFF_4_TAGS, + TiffTagConstants.ALL_TIFF_TAGS, ExifTagConstants.ALL_EXIF_TAGS, - TiffClassFTagConstants.ALL_TIFF_CLASS_F_TAGS, + Rfc2301TagConstants.ALL_RFC_2301_TAGS, AdobePageMaker6TagConstants.ALL_ADOBE_PAGEMAKER_6_TAG_CONSTANTS, GpsTagConstants.ALL_GPS_TAGS)); 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=1302103&r1=1302102&r2=1302103&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 09:25:59 2012 @@ -83,38 +83,8 @@ public interface ExifTagConstants public static final TagInfoLong EXIF_TAG_JPG_FROM_RAW_LENGTH_SUB_IFD2 = new TagInfoLong( "Jpg From Raw Length", 0x0117, 1, TiffDirectoryType.EXIF_DIRECTORY_SUB_IFD2); - public static final TagInfoShort EXIF_TAG_COLOR_RESPONSE_UNIT = new TagInfoShort( - "Color Response Unit", 0x012c, 1, - TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); public static final TagInfoUndefined EXIF_TAG_JPEGTABLES = new TagInfoUndefined("JPEGTables", 0x015b, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); - public static final TagInfoLong EXIF_TAG_GLOBAL_PARAMETERS_IFD = new TagInfoLong( - "Global Parameters IFD", 0x0190, 1, - TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN, true); - public static final TagInfoLong EXIF_TAG_PROFILE_TYPE = new TagInfoLong( - "Profile Type", 0x0191, 1, - TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); - public static final int PROFILE_TYPE_VALUE_UNSPECIFIED = 0; - public static final int PROFILE_TYPE_VALUE_GROUP_3_FAX = 1; - public static final TagInfoByte EXIF_TAG_FAX_PROFILE = new TagInfoByte( - "Fax Profile", 0x0192, 1, - TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); - public static final int FAX_PROFILE_VALUE_UNKNOWN = 0; - public static final int FAX_PROFILE_VALUE_MINIMAL_B_AND_W_LOSSLESS_S = 1; - public static final int FAX_PROFILE_VALUE_EXTENDED_B_AND_W_LOSSLESS_F = 2; - public static final int FAX_PROFILE_VALUE_LOSSLESS_JBIG_B_AND_W_J = 3; - public static final int FAX_PROFILE_VALUE_LOSSY_COLOR_AND_GRAYSCALE_C = 4; - public static final int FAX_PROFILE_VALUE_LOSSLESS_COLOR_AND_GRAYSCALE_L = 5; - public static final int FAX_PROFILE_VALUE_MIXED_RASTER_CONTENT_M = 6; - public static final TagInfoLong EXIF_TAG_CODING_METHODS = new TagInfoLong( - "Coding Methods", 0x0193, 1, - TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); - public static final TagInfoByte EXIF_TAG_VERSION_YEAR = new TagInfoByte( - "Version Year", 0x0194, 4, - TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); - public static final TagInfoByte EXIF_TAG_MODE_NUMBER = new TagInfoByte( - "Mode Number", 0x0195, 1, - TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); public static final TagInfoRational EXIF_TAG_DECODE = new TagInfoRational("Decode", 0x01b1, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); public static final TagInfoShort EXIF_TAG_DEFAULT_IMAGE_COLOR = new TagInfoShort( @@ -1050,11 +1020,8 @@ public interface ExifTagConstants EXIF_TAG_PREVIEW_IMAGE_LENGTH_IFD0, EXIF_TAG_PREVIEW_IMAGE_LENGTH_SUB_IFD1, EXIF_TAG_JPG_FROM_RAW_LENGTH_SUB_IFD2, - EXIF_TAG_COLOR_RESPONSE_UNIT, 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, + EXIF_TAG_DECODE, EXIF_TAG_DEFAULT_IMAGE_COLOR, EXIF_TAG_PREVIEW_IMAGE_START_MAKER_NOTES, EXIF_TAG_JPG_FROM_RAW_START_SUB_IFD, Added: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/Rfc2301TagConstants.java URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/Rfc2301TagConstants.java?rev=1302103&view=auto ============================================================================== --- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/Rfc2301TagConstants.java (added) +++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/Rfc2301TagConstants.java Sun Mar 18 09:25:59 2012 @@ -0,0 +1,82 @@ +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.TagInfoByte; +import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfoLong; +import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfoShort; +import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfoShortOrLong; + +/** + * RFC 2301: File Format for Internet Fax + * <BR> + * www.ietf.org/rfc/rfc2301.txt + * <BR> + * Also subsumes "The spirit of TIFF class F" + * <BR> + * http://cool.conservation-us.org/bytopic/imaging/std/tiff-f.html + */ +public interface Rfc2301TagConstants 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 TagInfoLong TIFF_TAG_GLOBAL_PARAMETERS_IFD = new TagInfoLong( + "Global Parameters IFD", 0x0190, 1, + TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN, true); + + public static final TagInfoLong TIFF_TAG_PROFILE_TYPE = new TagInfoLong( + "Profile Type", 0x0191, 1, + TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + public static final int PROFILE_TYPE_VALUE_UNSPECIFIED = 0; + public static final int PROFILE_TYPE_VALUE_GROUP_3_FAX = 1; + + public static final TagInfoByte TIFF_TAG_FAX_PROFILE = new TagInfoByte( + "Fax Profile", 0x0192, 1, + TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + public static final int FAX_PROFILE_VALUE_UNKNOWN = 0; + public static final int FAX_PROFILE_VALUE_MINIMAL_B_AND_W_LOSSLESS_S = 1; + public static final int FAX_PROFILE_VALUE_EXTENDED_B_AND_W_LOSSLESS_F = 2; + public static final int FAX_PROFILE_VALUE_LOSSLESS_JBIG_B_AND_W_J = 3; + public static final int FAX_PROFILE_VALUE_LOSSY_COLOR_AND_GRAYSCALE_C = 4; + public static final int FAX_PROFILE_VALUE_LOSSLESS_COLOR_AND_GRAYSCALE_L = 5; + public static final int FAX_PROFILE_VALUE_MIXED_RASTER_CONTENT_M = 6; + + public static final TagInfoLong TIFF_TAG_CODING_METHODS = new TagInfoLong( + "Coding Methods", 0x0193, 1, + TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + + public static final TagInfoByte TIFF_TAG_VERSION_YEAR = new TagInfoByte( + "Version Year", 0x0194, 4, + TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + + public static final TagInfoByte TIFF_TAG_MODE_NUMBER = new TagInfoByte( + "Mode Number", 0x0195, 1, + TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + + public static final List<TagInfo> ALL_RFC_2301_TAGS = + Collections.unmodifiableList(Arrays.asList( + TIFF_TAG_BAD_FAX_LINES, + TIFF_TAG_CLEAN_FAX_DATA, + TIFF_TAG_CONSECUTIVE_BAD_FAX_LINES, + TIFF_TAG_GLOBAL_PARAMETERS_IFD, + TIFF_TAG_PROFILE_TYPE, + TIFF_TAG_FAX_PROFILE, + TIFF_TAG_CODING_METHODS, + TIFF_TAG_VERSION_YEAR, + TIFF_TAG_MODE_NUMBER)); +} Propchange: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/Rfc2301TagConstants.java ------------------------------------------------------------------------------ svn:eol-style = native Added: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/Tiff4TagConstants.java URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/Tiff4TagConstants.java?rev=1302103&view=auto ============================================================================== --- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/Tiff4TagConstants.java (added) +++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/Tiff4TagConstants.java Sun Mar 18 09:25:59 2012 @@ -0,0 +1,28 @@ +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; + +/** + * Tags in TIFF4 but NOT in TIFF6. + * <BR> + * http://cool.conservation-us.org/bytopic/imaging/std/tiff4.html + */ +public class Tiff4TagConstants { + public static final TagInfoShort TIFF_TAG_COLOR_RESPONSE_UNIT = new TagInfoShort( + "Color Response Unit", 0x12C, 1, + TiffDirectoryType.TIFF_DIRECTORY_ROOT); + public static final int COLOR_RESPONSE_UNIT_VALUE_0_1 = 1; + public static final int COLOR_RESPONSE_UNIT_VALUE_0_01 = 2; + public static final int COLOR_RESPONSE_UNIT_VALUE_0_001 = 3; + public static final int COLOR_RESPONSE_UNIT_VALUE_0_0001 = 4; + public static final int COLOR_RESPONSE_UNIT_VALUE_0_00001 = 5; + + public static final List<TagInfo> ALL_TIFF_4_TAGS = + Collections.unmodifiableList(Arrays.asList( + new TagInfo[] {TIFF_TAG_COLOR_RESPONSE_UNIT})); +} Propchange: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/constants/Tiff4TagConstants.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=1302103&r1=1302102&r2=1302103&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 09:25:59 2012 @@ -33,6 +33,8 @@ import org.apache.commons.sanselan.forma /** * Tags from the TIFF6 specification. + * <BR> + * http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf */ public interface TiffTagConstants extends @@ -232,10 +234,10 @@ public interface TiffTagConstants "Gray Response Unit", 0x122, 1, TiffDirectoryType.TIFF_DIRECTORY_ROOT); public static final int GRAY_RESPONSE_UNIT_VALUE_0_1 = 1; - public static final int GRAY_RESPONSE_UNIT_VALUE_0_001 = 2; - public static final int GRAY_RESPONSE_UNIT_VALUE_0_0001 = 3; - public static final int GRAY_RESPONSE_UNIT_VALUE_1E_05 = 4; - public static final int GRAY_RESPONSE_UNIT_VALUE_1E_06 = 5; + public static final int GRAY_RESPONSE_UNIT_VALUE_0_01 = 2; + public static final int GRAY_RESPONSE_UNIT_VALUE_0_001 = 3; + public static final int GRAY_RESPONSE_UNIT_VALUE_0_0001 = 4; + public static final int GRAY_RESPONSE_UNIT_VALUE_0_00001 = 5; public static final TagInfoShort TIFF_TAG_GRAY_RESPONSE_CURVE = new TagInfoShort( "Gray Response Curve", 0x123, -1, 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=1302103&r1=1302102&r2=1302103&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 09:25:59 2012 @@ -23,7 +23,7 @@ import org.apache.commons.sanselan.Sanse 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.Rfc2301TagConstants; import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants; import org.apache.commons.sanselan.formats.tiff.taginfos.TagInfo; @@ -32,7 +32,7 @@ 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(Rfc2301TagConstants.class, Rfc2301TagConstants.ALL_RFC_2301_TAGS); verifyFields(AdobePageMaker6TagConstants.class, AdobePageMaker6TagConstants.ALL_ADOBE_PAGEMAKER_6_TAG_CONSTANTS); }