commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1241131 [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/write/ test/java/or...
Date Mon, 06 Feb 2012 19:55:31 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=1241131&r1=1241130&r2=1241131&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
Mon Feb  6 19:55:30 2012
@@ -16,10 +16,14 @@
  */
 package org.apache.commons.sanselan.formats.tiff.constants;
 
+import java.util.Collections;
+import java.util.List;
+
 public enum GpsTagConstants
         implements
             TiffDirectoryConstants,
-            TiffFieldTypeConstants
+            TiffFieldTypeConstants,
+            TagHolder
 {
     GPS_VERSION_ID(new TagInfo(
             "GPS Version ID", 0x0000, FIELD_TYPE_DESCRIPTION_BYTE, 4,
@@ -208,12 +212,10 @@ public enum GpsTagConstants
 
     // ************************************************************
 
-    public static final TagInfo[] ALL_GPS_TAGS;
-    static {
-        GpsTagConstants[] gpsTagConstants = values();
-        ALL_GPS_TAGS = new TagInfo[gpsTagConstants.length];
-        for (int i = 0; i < gpsTagConstants.length; i++) {
-            ALL_GPS_TAGS[i] = gpsTagConstants[i].tagInfo;
-        }
+    public TagInfo getTagInfo() {
+        return tagInfo;
     }
+    
+    public static final List<TagInfo> ALL_GPS_TAGS = Collections.unmodifiableList(
+            TagConstantsUtils.mergeTagLists(values()));
 }

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=1241131&r1=1241130&r2=1241131&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
Mon Feb  6 19:55:30 2012
@@ -16,22 +16,25 @@
  */
 package org.apache.commons.sanselan.formats.tiff.constants;
 
+import java.util.ArrayList;
+import java.util.List;
+
 public class TagConstantsUtils implements TiffDirectoryConstants
 {
 
-    public static TagInfo[] mergeTagLists(TagInfo lists[][])
+    public static List<TagInfo> mergeTagLists(TagHolder[]... tagHolders)
     {
         int count = 0;
-        for (int i = 0; i < lists.length; i++)
-            count += lists[i].length;
+        for (int i = 0; i < tagHolders.length; i++) {
+            count += tagHolders[i].length;
+        }
 
-        TagInfo result[] = new TagInfo[count];
+        ArrayList<TagInfo> result = new ArrayList<TagInfo>(count);
 
-        int index = 0;
-        for (int i = 0; i < lists.length; i++)
-        {
-            System.arraycopy(lists[i], 0, result, index, lists[i].length);
-            index += lists[i].length;
+        for (int i = 0; i < tagHolders.length; i++) {
+            for (int j = 0; j < tagHolders[i].length; j++) {
+                result.add(tagHolders[i][j].getTagInfo());
+            }
         }
 
         return result;

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=1241131&r1=1241130&r2=1241131&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 19:55:30 2012
@@ -16,7 +16,10 @@
  */
 package org.apache.commons.sanselan.formats.tiff.constants;
 
-public enum TiffTagConstants implements TiffFieldTypeConstants, TiffDirectoryConstants
+import java.util.Collections;
+import java.util.List;
+
+public enum TiffTagConstants implements TiffFieldTypeConstants, TiffDirectoryConstants, TagHolder
 {
 
     NEW_SUBFILE_TYPE(new TagInfo(
@@ -311,12 +314,10 @@ public enum TiffTagConstants implements 
         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;
-        }
+    public TagInfo getTagInfo() {
+        return tagInfo;
     }
+    
+    public static final List<TagInfo> ALL_TIFF_TAGS = Collections.unmodifiableList(
+            TagConstantsUtils.mergeTagLists(values()));
 }
\ No newline at end of file

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=1241131&r1=1241130&r2=1241131&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 19:55:30 2012
@@ -26,7 +26,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.sanselan.ImageReadException;
 import org.apache.commons.sanselan.ImageWriteException;
 import org.apache.commons.sanselan.common.BinaryConstants;
 import org.apache.commons.sanselan.common.BinaryOutputStream;
@@ -35,6 +34,7 @@ import org.apache.commons.sanselan.commo
 import org.apache.commons.sanselan.common.mylzw.MyLzwCompressor;
 import org.apache.commons.sanselan.formats.tiff.TiffElement;
 import org.apache.commons.sanselan.formats.tiff.TiffImageData;
+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;
 
@@ -140,19 +140,19 @@ public abstract class TiffImageWriterBas
                             + ") appears twice in directory.");
                 fieldTags.add(fieldKey);
 
-                if (field.tag == EXIF_TAG_EXIF_OFFSET.tag)
+                if (field.tag == ExifTagConstants.EXIF_OFFSET.tagInfo.tag)
                 {
                     if (exifDirectoryOffsetField != null)
                         throw new ImageWriteException(
                                 "More than one Exif directory offset field.");
                     exifDirectoryOffsetField = field;
-                } else if (field.tag == EXIF_TAG_INTEROP_OFFSET.tag)
+                } else if (field.tag == ExifTagConstants.INTEROP_OFFSET.tagInfo.tag)
                 {
                     if (interoperabilityDirectoryOffsetField != null)
                         throw new ImageWriteException(
                                 "More than one Interoperability directory offset field.");
                     interoperabilityDirectoryOffsetField = field;
-                } else if (field.tag == EXIF_TAG_GPSINFO.tag)
+                } else if (field.tag == ExifTagConstants.GPSINFO.tagInfo.tag)
                 {
                     if (gpsDirectoryOffsetField != null)
                         throw new ImageWriteException(
@@ -208,7 +208,7 @@ public abstract class TiffImageWriterBas
             if (interoperabilityDirectoryOffsetField == null)
             {
                 interoperabilityDirectoryOffsetField = TiffOutputField
-                        .createOffsetField(EXIF_TAG_INTEROP_OFFSET, byteOrder);
+                        .createOffsetField(ExifTagConstants.INTEROP_OFFSET.tagInfo, byteOrder);
                 exifDirectory.add(interoperabilityDirectoryOffsetField);
             }
 
@@ -227,7 +227,7 @@ public abstract class TiffImageWriterBas
             if (exifDirectoryOffsetField == null)
             {
                 exifDirectoryOffsetField = TiffOutputField.createOffsetField(
-                        EXIF_TAG_EXIF_OFFSET, byteOrder);
+                        ExifTagConstants.EXIF_OFFSET.tagInfo, byteOrder);
                 rootDirectory.add(exifDirectoryOffsetField);
             }
 
@@ -244,7 +244,7 @@ public abstract class TiffImageWriterBas
             if (gpsDirectoryOffsetField == null)
             {
                 gpsDirectoryOffsetField = TiffOutputField.createOffsetField(
-                        EXIF_TAG_GPSINFO, byteOrder);
+                        ExifTagConstants.GPSINFO.tagInfo, byteOrder);
                 rootDirectory.add(gpsDirectoryOffsetField);
             }
 

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffImageWriterLossless.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffImageWriterLossless.java?rev=1241131&r1=1241130&r2=1241131&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffImageWriterLossless.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/write/TiffImageWriterLossless.java
Mon Feb  6 19:55:30 2012
@@ -38,6 +38,7 @@ import org.apache.commons.sanselan.forma
 import org.apache.commons.sanselan.formats.tiff.TiffField;
 import org.apache.commons.sanselan.formats.tiff.TiffImageData;
 import org.apache.commons.sanselan.formats.tiff.TiffReader;
+import org.apache.commons.sanselan.formats.tiff.constants.ExifTagConstants;
 import org.apache.commons.sanselan.util.Debug;
 
 public class TiffImageWriterLossless extends TiffImageWriterBase
@@ -142,7 +143,7 @@ public class TiffImageWriterLossless ext
                 for (int f = 0; f < fields.size(); f++)
                 {
                     TiffField field = fields.get(f);
-                    if (field.tag == EXIF_TAG_MAKER_NOTE.tag) {
+                    if (field.tag == ExifTagConstants.MAKER_NOTE.tagInfo.tag) {
                         // Some maker notes reference values stored
                         // inside the maker note itself
                         // using addresses relative to the beginning

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=1241131&r1=1241130&r2=1241131&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 19:55:30 2012
@@ -27,6 +27,7 @@ import org.apache.commons.sanselan.commo
 import org.apache.commons.sanselan.formats.jpeg.JpegImageMetadata;
 import org.apache.commons.sanselan.formats.tiff.TiffField;
 import org.apache.commons.sanselan.formats.tiff.TiffImageMetadata;
+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.TagInfo;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffConstants;
@@ -60,13 +61,13 @@ public class MetadataExample
             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);
-            printTagValue(jpegMetadata, TiffConstants.EXIF_TAG_ISO);
+                    ExifTagConstants.DATE_TIME_ORIGINAL.tagInfo);
+            printTagValue(jpegMetadata, ExifTagConstants.CREATE_DATE.tagInfo);
+            printTagValue(jpegMetadata, ExifTagConstants.ISO.tagInfo);
             printTagValue(jpegMetadata,
-                    TiffConstants.EXIF_TAG_SHUTTER_SPEED_VALUE);
-            printTagValue(jpegMetadata, TiffConstants.EXIF_TAG_APERTURE_VALUE);
-            printTagValue(jpegMetadata, TiffConstants.EXIF_TAG_BRIGHTNESS_VALUE);
+                    ExifTagConstants.SHUTTER_SPEED_VALUE.tagInfo);
+            printTagValue(jpegMetadata, ExifTagConstants.APERTURE_VALUE.tagInfo);
+            printTagValue(jpegMetadata, ExifTagConstants.BRIGHTNESS_VALUE.tagInfo);
             printTagValue(jpegMetadata, GpsTagConstants.GPS_LATITUDE_REF.tagInfo);
             printTagValue(jpegMetadata, GpsTagConstants.GPS_LATITUDE.tagInfo);
             printTagValue(jpegMetadata, GpsTagConstants.GPS_LONGITUDE_REF.tagInfo);

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/WriteExifMetadataExample.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/WriteExifMetadataExample.java?rev=1241131&r1=1241130&r2=1241131&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/WriteExifMetadataExample.java
(original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/WriteExifMetadataExample.java
Mon Feb  6 19:55:30 2012
@@ -29,6 +29,7 @@ import org.apache.commons.sanselan.commo
 import org.apache.commons.sanselan.formats.jpeg.JpegImageMetadata;
 import org.apache.commons.sanselan.formats.jpeg.exif.ExifRewriter;
 import org.apache.commons.sanselan.formats.tiff.TiffImageMetadata;
+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.write.TiffOutputDirectory;
 import org.apache.commons.sanselan.formats.tiff.write.TiffOutputField;
@@ -125,14 +126,14 @@ public class WriteExifMetadataExample
                 // org.apache.commons.sanselan.formats.tiff.constants.AllTagConstants
                 //
                 TiffOutputField aperture = TiffOutputField.create(
-                        TiffConstants.EXIF_TAG_APERTURE_VALUE,
+                        ExifTagConstants.APERTURE_VALUE.tagInfo,
                         outputSet.byteOrder, new Double(0.3));
                 TiffOutputDirectory exifDirectory = outputSet
                         .getOrCreateExifDirectory();
                 // make sure to remove old value if present (this method will
                 // not fail if the tag does not exist).
                 exifDirectory
-                        .removeField(TiffConstants.EXIF_TAG_APERTURE_VALUE);
+                        .removeField(ExifTagConstants.APERTURE_VALUE.tagInfo);
                 exifDirectory.add(aperture);
             }
 
@@ -231,7 +232,7 @@ public class WriteExifMetadataExample
                 // Note that this approach is crude: Exif data is organized in
                 // directories. The same tag/field may appear in more than one
                 // directory, and have different meanings in each.
-                outputSet.removeField(TiffConstants.EXIF_TAG_APERTURE_VALUE);
+                outputSet.removeField(ExifTagConstants.APERTURE_VALUE.tagInfo);
 
                 // Option 2: precision
                 // We know the exact directory the tag should appear in, in this
@@ -245,7 +246,7 @@ public class WriteExifMetadataExample
                         .getExifDirectory();
                 if (null != exifDirectory)
                     exifDirectory
-                            .removeField(TiffConstants.EXIF_TAG_APERTURE_VALUE);
+                            .removeField(ExifTagConstants.APERTURE_VALUE.tagInfo);
             }
 
             os = new FileOutputStream(dst);

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/AsciiFieldTest.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/AsciiFieldTest.java?rev=1241131&r1=1241130&r2=1241131&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/AsciiFieldTest.java
(original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/AsciiFieldTest.java
Mon Feb  6 19:55:30 2012
@@ -30,6 +30,7 @@ import org.apache.commons.sanselan.forma
 import org.apache.commons.sanselan.formats.tiff.TiffField;
 import org.apache.commons.sanselan.formats.tiff.TiffImageMetadata;
 import org.apache.commons.sanselan.formats.tiff.constants.AllTagConstants;
+import org.apache.commons.sanselan.formats.tiff.constants.ExifTagConstants;
 
 public class AsciiFieldTest extends ExifBaseTest implements AllTagConstants {
 
@@ -58,9 +59,9 @@ public class AsciiFieldTest extends Exif
         }
 
         Map expectedFieldValues = new Hashtable();
-        expectedFieldValues.put(new Integer(EXIF_TAG_MAKE.tag), "Canon");
-        expectedFieldValues.put(new Integer(EXIF_TAG_MODEL.tag), "Canon PowerShot SD750");
-        expectedFieldValues.put(new Integer(EXIF_TAG_MODIFY_DATE.tag), "2007:12:25 13:34:39");
+        expectedFieldValues.put(new Integer(ExifTagConstants.MAKE.tagInfo.tag), "Canon");
+        expectedFieldValues.put(new Integer(ExifTagConstants.MODEL.tagInfo.tag), "Canon PowerShot
SD750");
+        expectedFieldValues.put(new Integer(ExifTagConstants.MODIFY_DATE.tagInfo.tag), "2007:12:25
13:34:39");
         Iterator expectedTags = expectedFieldValues.keySet().iterator();
         while (expectedTags.hasNext()) {
             Integer tag = (Integer) expectedTags.next();

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/ExifRewriteTest.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/ExifRewriteTest.java?rev=1241131&r1=1241130&r2=1241131&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/ExifRewriteTest.java
(original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/ExifRewriteTest.java
Mon Feb  6 19:55:30 2012
@@ -40,6 +40,7 @@ import org.apache.commons.sanselan.forma
 import org.apache.commons.sanselan.formats.tiff.TiffField;
 import org.apache.commons.sanselan.formats.tiff.TiffImageMetadata;
 import org.apache.commons.sanselan.formats.tiff.constants.AllTagConstants;
+import org.apache.commons.sanselan.formats.tiff.constants.TiffFieldTypeConstants;
 import org.apache.commons.sanselan.formats.tiff.write.TiffOutputSet;
 import org.apache.commons.sanselan.util.Debug;
 import org.apache.commons.sanselan.util.IoUtils;
@@ -428,7 +429,7 @@ public class ExifRewriteTest extends Exi
                     continue;
                 }
 
-                if (oldField.fieldType == FIELD_TYPE_ASCII)
+                if (oldField.fieldType == TiffFieldTypeConstants.FIELD_TYPE_ASCII)
                 {
                     // Sanselan currently doesn't correctly rewrite
                     // strings if any byte had the highest bit set,

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/MakerNoteFieldTest.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/MakerNoteFieldTest.java?rev=1241131&r1=1241130&r2=1241131&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/MakerNoteFieldTest.java
(original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/MakerNoteFieldTest.java
Mon Feb  6 19:55:30 2012
@@ -23,6 +23,7 @@ import java.io.IOException;
 import org.apache.commons.sanselan.ImageReadException;
 import org.apache.commons.sanselan.ImageWriteException;
 import org.apache.commons.sanselan.formats.tiff.TiffField;
+import org.apache.commons.sanselan.formats.tiff.constants.ExifTagConstants;
 import org.apache.commons.sanselan.util.Debug;
 
 public class MakerNoteFieldTest extends SpecificExifTagTest
@@ -35,7 +36,7 @@ public class MakerNoteFieldTest extends 
     protected void checkField(File imageFile, TiffField field)
             throws IOException, ImageReadException, ImageWriteException
     {
-        if (field.tag != EXIF_TAG_MAKER_NOTE.tag)
+        if (field.tag != ExifTagConstants.MAKER_NOTE.tagInfo.tag)
         {
             //            if (field.tag == EXIF_TAG_EXIF_OFFSET.tag)
             //                ;

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=1241131&r1=1241130&r2=1241131&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
Mon Feb  6 19:55:30 2012
@@ -23,7 +23,9 @@ import java.io.IOException;
 import org.apache.commons.sanselan.ImageReadException;
 import org.apache.commons.sanselan.ImageWriteException;
 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.util.Debug;
 
 public class TextFieldTest extends SpecificExifTagTest
@@ -36,13 +38,13 @@ public class TextFieldTest extends Speci
     protected void checkField(File imageFile, TiffField field)
             throws IOException, ImageReadException, ImageWriteException
     {
-        if (field.tag == EXIF_TAG_USER_COMMENT.tag)
+        if (field.tag == ExifTagConstants.USER_COMMENT.tagInfo.tag)
         { /* do nothing */ }
         else if (field.tag == GpsTagConstants.GPS_PROCESSING_METHOD.tagInfo.tag
-                && field.directoryType == EXIF_DIRECTORY_GPS.directoryType)
+                && field.directoryType == TiffDirectoryConstants.EXIF_DIRECTORY_GPS.directoryType)
         { /* do nothing */ }
         else if (field.tag == GpsTagConstants.GPS_AREA_INFORMATION.tagInfo.tag
-                && field.directoryType == EXIF_DIRECTORY_GPS.directoryType)
+                && field.directoryType == TiffDirectoryConstants.EXIF_DIRECTORY_GPS.directoryType)
         { /* do nothing */ }
         else
             return;

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=1241131&r1=1241130&r2=1241131&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 19:55:30 2012
@@ -19,7 +19,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.ExifTagConstants;
 import org.apache.commons.sanselan.formats.tiff.constants.TiffTagConstants;
 import org.apache.commons.sanselan.formats.tiff.write.TiffOutputField;
 
@@ -29,7 +29,7 @@ public class WriteTagsTest extends ExifB
     public void test2SHORTS() throws Exception
     {
         TiffOutputField.create(
-            TiffConstants.EXIF_TAG_PAGE_NUMBER,
+            ExifTagConstants.PAGE_NUMBER.tagInfo,
             BinaryConstants.BYTE_ORDER_LITTLE_ENDIAN,
             new Integer[] { new Integer(1), new Integer(10) } );
     }



Mime
View raw message