commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1342971 [12/20] - in /commons/proper/imaging/trunk/src: main/java/org/apache/commons/imaging/formats/bmp/ main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/ main/java/org/apache/commons/imaging/formats/bmp/writers/ main/java/or...
Date Sat, 26 May 2012 21:19:22 GMT
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java Sat May 26 21:19:03 2012
@@ -20,48 +20,39 @@ import org.apache.commons.imaging.ImageW
 import org.apache.commons.imaging.formats.tiff.TiffField;
 import org.apache.commons.imaging.util.Debug;
 
-public class FieldTypeLong extends FieldType
-{
-    public FieldTypeLong(int type, String name)
-    {
+public class FieldTypeLong extends FieldType {
+    public FieldTypeLong(int type, String name) {
         super(type, 4, name);
     }
 
     @Override
-    public Object getSimpleValue(TiffField entry)
-    {
+    public Object getSimpleValue(TiffField entry) {
         if (entry.length == 1)
-            return convertByteArrayToInt(name + " ("
-                    + entry.tagInfo.name + ")", entry.valueOffsetBytes,
-                    entry.byteOrder);
+            return convertByteArrayToInt(
+                    name + " (" + entry.tagInfo.name + ")",
+                    entry.valueOffsetBytes, entry.byteOrder);
 
         return convertByteArrayToIntArray(name + " (" + entry.tagInfo.name
                 + ")", getRawBytes(entry), 0, entry.length, entry.byteOrder);
     }
 
     @Override
-    public byte[] writeData(Object o, int byteOrder) throws ImageWriteException
-    {
+    public byte[] writeData(Object o, int byteOrder) throws ImageWriteException {
         if (o instanceof Integer)
-            return convertIntArrayToByteArray(new int[]{
-                ((Integer) o).intValue(),
-            }, byteOrder);
-        else if (o instanceof int[])
-        {
+            return convertIntArrayToByteArray(
+                    new int[] { ((Integer) o).intValue(), }, byteOrder);
+        else if (o instanceof int[]) {
             int numbers[] = (int[]) o;
             return convertIntArrayToByteArray(numbers, byteOrder);
-        }
-        else if (o instanceof Integer[])
-        {
+        } else if (o instanceof Integer[]) {
             Integer numbers[] = (Integer[]) o;
             int values[] = new int[numbers.length];
             for (int i = 0; i < values.length; i++)
                 values[i] = numbers[i].intValue();
             return convertIntArrayToByteArray(values, byteOrder);
-        }
-        else
+        } else
             throw new ImageWriteException("Invalid data: " + o + " ("
                     + Debug.getType(o) + ")");
     }
 
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeRational.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeRational.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeRational.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeRational.java Sat May 26 21:19:03 2012
@@ -22,16 +22,13 @@ import org.apache.commons.imaging.common
 import org.apache.commons.imaging.formats.tiff.TiffField;
 import org.apache.commons.imaging.util.Debug;
 
-public class FieldTypeRational extends FieldType
-{
-    public FieldTypeRational(int type, String name)
-    {
+public class FieldTypeRational extends FieldType {
+    public FieldTypeRational(int type, String name) {
         super(type, 8, name);
     }
 
     @Override
-    public Object getSimpleValue(TiffField entry)
-    {
+    public Object getSimpleValue(TiffField entry) {
         if (entry.length == 1)
             return convertByteArrayToRational(name + " (" + entry.tagInfo.name
                     + ")", entry.oversizeValue, entry.byteOrder);
@@ -41,65 +38,49 @@ public class FieldTypeRational extends F
     }
 
     @Override
-    public byte[] writeData(Object o, int byteOrder) throws ImageWriteException
-    {
+    public byte[] writeData(Object o, int byteOrder) throws ImageWriteException {
         if (o instanceof RationalNumber)
             return convertRationalToByteArray((RationalNumber) o, byteOrder);
-        else if (o instanceof RationalNumber[])
-        {
+        else if (o instanceof RationalNumber[]) {
             return convertRationalArrayToByteArray((RationalNumber[]) o,
                     byteOrder);
-        }
-        else if (o instanceof Number)
-        {
+        } else if (o instanceof Number) {
             Number number = (Number) o;
             RationalNumber rationalNumber = RationalNumberUtilities
                     .getRationalNumber(number.doubleValue());
             return convertRationalToByteArray(rationalNumber, byteOrder);
-        }
-        else if (o instanceof Number[])
-        {
+        } else if (o instanceof Number[]) {
             Number numbers[] = (Number[]) o;
             RationalNumber rationalNumbers[] = new RationalNumber[numbers.length];
-            for (int i = 0; i < numbers.length; i++)
-            {
+            for (int i = 0; i < numbers.length; i++) {
                 Number number = numbers[i];
                 rationalNumbers[i] = RationalNumberUtilities
                         .getRationalNumber(number.doubleValue());
             }
             return convertRationalArrayToByteArray(rationalNumbers, byteOrder);
-        }
-        else if (o instanceof double[])
-        {
+        } else if (o instanceof double[]) {
             double numbers[] = (double[]) o;
             RationalNumber rationalNumbers[] = new RationalNumber[numbers.length];
-            for (int i = 0; i < numbers.length; i++)
-            {
+            for (int i = 0; i < numbers.length; i++) {
                 double number = numbers[i];
                 rationalNumbers[i] = RationalNumberUtilities
                         .getRationalNumber(number);
             }
             return convertRationalArrayToByteArray(rationalNumbers, byteOrder);
-        }
-        else
+        } else
             throw new ImageWriteException("Invalid data: " + o + " ("
                     + Debug.getType(o) + ")");
     }
 
     public byte[] writeData(int numerator, int denominator, int byteOrder)
-            throws ImageWriteException
-    {
-        return writeData(new int[]{
-            numerator
-        }, new int[]{
-            denominator
-        }, byteOrder);
+            throws ImageWriteException {
+        return writeData(new int[] { numerator }, new int[] { denominator },
+                byteOrder);
     }
 
     public byte[] writeData(int numerators[], int denominators[], int byteOrder)
-            throws ImageWriteException
-    {
+            throws ImageWriteException {
         return convertIntArrayToRationalArray(numerators, denominators,
                 byteOrder);
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeShort.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeShort.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeShort.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeShort.java Sat May 26 21:19:03 2012
@@ -22,59 +22,52 @@ import org.apache.commons.imaging.common
 import org.apache.commons.imaging.formats.tiff.TiffField;
 import org.apache.commons.imaging.util.Debug;
 
-public class FieldTypeShort extends FieldType
-{
-    public FieldTypeShort(int type, String name)
-    {
+public class FieldTypeShort extends FieldType {
+    public FieldTypeShort(int type, String name) {
         super(type, 2, name);
     }
 
-    //    public Object[] getValueArray(TiffField entry)
-    //    {
-    //        if(isLocalValue(entry))
-    //            return convertByteArrayToShortArray(name + " (" + entry.tagInfo.name
-    //                    + ")", entry.valueOffsetBytes, 0, entry.length, entry.byteOrder);
+    // public Object[] getValueArray(TiffField entry)
+    // {
+    // if(isLocalValue(entry))
+    // return convertByteArrayToShortArray(name + " (" + entry.tagInfo.name
+    // + ")", entry.valueOffsetBytes, 0, entry.length, entry.byteOrder);
     //
-    ////        return new Integer(convertByteArrayToShort(name + " ("
-    ////                + entry.tagInfo.name + ")", entry.valueOffsetBytes,
-    ////                entry.byteOrder));
+    // // return new Integer(convertByteArrayToShort(name + " ("
+    // // + entry.tagInfo.name + ")", entry.valueOffsetBytes,
+    // // entry.byteOrder));
     //
-    //        return convertByteArrayToShortArray(name + " (" + entry.tagInfo.name
-    //                + ")", getRawBytes(entry), 0, entry.length, entry.byteOrder);
-    //    }
+    // return convertByteArrayToShortArray(name + " (" + entry.tagInfo.name
+    // + ")", getRawBytes(entry), 0, entry.length, entry.byteOrder);
+    // }
 
     @Override
-    public Object getSimpleValue(TiffField entry) throws ImageReadException
-    {
+    public Object getSimpleValue(TiffField entry) throws ImageReadException {
         if (entry.length == 1)
-            return BinaryConversions.convertToShort(entry.valueOffsetBytes, entry.byteOrder);
+            return BinaryConversions.convertToShort(entry.valueOffsetBytes,
+                    entry.byteOrder);
 
-        return BinaryConversions.convertToShortArray(getRawBytes(entry), entry.byteOrder);
+        return BinaryConversions.convertToShortArray(getRawBytes(entry),
+                entry.byteOrder);
     }
 
     @Override
-    public byte[] writeData(Object o, int byteOrder) throws ImageWriteException
-    {
+    public byte[] writeData(Object o, int byteOrder) throws ImageWriteException {
         if (o instanceof Short)
-            return BinaryConversions.convertToByteArray(new short[]{
-                ((Short)o).shortValue(),
-            }, byteOrder);
-        else if (o instanceof short[])
-        {
+            return BinaryConversions.convertToByteArray(
+                    new short[] { ((Short) o).shortValue(), }, byteOrder);
+        else if (o instanceof short[]) {
             short numbers[] = (short[]) o;
             return BinaryConversions.convertToByteArray(numbers, byteOrder);
-        }
-        else if (o instanceof Short[])
-        {
+        } else if (o instanceof Short[]) {
             Short numbers[] = (Short[]) o;
             short values[] = new short[numbers.length];
             for (int i = 0; i < values.length; i++)
                 values[i] = numbers[i].shortValue();
             return BinaryConversions.convertToByteArray(values, byteOrder);
-        }
-        else
+        } else
             throw new ImageWriteException("Invalid data: " + o + " ("
                     + Debug.getType(o) + ")");
     }
 
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeUnknown.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeUnknown.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeUnknown.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeUnknown.java Sat May 26 21:19:03 2012
@@ -20,22 +20,22 @@ import org.apache.commons.imaging.ImageW
 import org.apache.commons.imaging.formats.tiff.TiffField;
 import org.apache.commons.imaging.util.Debug;
 
-public class FieldTypeUnknown extends FieldType
-{
-    public FieldTypeUnknown()
-    {
+public class FieldTypeUnknown extends FieldType {
+    public FieldTypeUnknown() {
         super(-1, 1, "Unknown");
     }
 
     @Override
-    public Object getSimpleValue(TiffField entry)
-    {
-        //        Debug.debug("unknown field type. entry", entry.tagInfo.name);
-        //        Debug.debug("unknown field type. entry.type", entry.type);
-        //        Debug.debug("unknown field type. entry.length", entry.length);
-        //        Debug.debug("unknown field type. entry.oversizeValue", entry.oversizeValue);
-        //        Debug.debug("unknown field type. entry.isLocalValue()", entry.isLocalValue());
-        //        Debug.debug("unknown field type. entry.oversizeValue", entry.oversizeValue);
+    public Object getSimpleValue(TiffField entry) {
+        // Debug.debug("unknown field type. entry", entry.tagInfo.name);
+        // Debug.debug("unknown field type. entry.type", entry.type);
+        // Debug.debug("unknown field type. entry.length", entry.length);
+        // Debug.debug("unknown field type. entry.oversizeValue",
+        // entry.oversizeValue);
+        // Debug.debug("unknown field type. entry.isLocalValue()",
+        // entry.isLocalValue());
+        // Debug.debug("unknown field type. entry.oversizeValue",
+        // entry.oversizeValue);
 
         if (entry.length == 1)
             return entry.valueOffsetBytes[0];
@@ -44,12 +44,9 @@ public class FieldTypeUnknown extends Fi
     }
 
     @Override
-    public byte[] writeData(Object o, int byteOrder) throws ImageWriteException
-    {
+    public byte[] writeData(Object o, int byteOrder) throws ImageWriteException {
         if (o instanceof Byte)
-            return new byte[]{
-                ((Byte) o).byteValue(),
-            };
+            return new byte[] { ((Byte) o).byteValue(), };
         else if (o instanceof byte[])
             return (byte[]) o;
         else
@@ -57,4 +54,4 @@ public class FieldTypeUnknown extends Fi
                     + Debug.getType(o) + ")");
     }
 
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreter.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreter.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreter.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreter.java Sat May 26 21:19:03 2012
@@ -21,8 +21,7 @@ import java.io.IOException;
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.common.ImageBuilder;
 
-public abstract class PhotometricInterpreter
-{
+public abstract class PhotometricInterpreter {
     protected final int samplesPerPixel;
     protected final int bitsPerSample[];
     protected final int predictor;
@@ -30,8 +29,7 @@ public abstract class PhotometricInterpr
     protected final int height;
 
     public PhotometricInterpreter(int fSamplesPerPixel, int fBitsPerSample[],
-            int Predictor, int width, int height)
-    {
+            int Predictor, int width, int height) {
         this.samplesPerPixel = fSamplesPerPixel;
         this.bitsPerSample = fBitsPerSample;
         this.predictor = Predictor;
@@ -39,16 +37,17 @@ public abstract class PhotometricInterpr
         this.height = height;
     }
 
-    public abstract void interpretPixel(ImageBuilder imageBuilder, int samples[], int x,
-            int y) throws ImageReadException, IOException;
+    public abstract void interpretPixel(ImageBuilder imageBuilder,
+            int samples[], int x, int y) throws ImageReadException, IOException;
 
     /**
-     * @throws ImageReadException may be thrown by sub-classes
-     * @throws IOException may be thrown by sub-classes
+     * @throws ImageReadException
+     *             may be thrown by sub-classes
+     * @throws IOException
+     *             may be thrown by sub-classes
      */
-    public void dumpstats() throws ImageReadException, IOException
-    {
+    public void dumpstats() throws ImageReadException, IOException {
 
     }
 
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterBiLevel.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterBiLevel.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterBiLevel.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterBiLevel.java Sat May 26 21:19:03 2012
@@ -21,26 +21,23 @@ import java.io.IOException;
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.common.ImageBuilder;
 
-public class PhotometricInterpreterBiLevel extends PhotometricInterpreter
-{
+public class PhotometricInterpreterBiLevel extends PhotometricInterpreter {
     private final boolean invert;
 
-    //    private final int bitsPerPixel;
+    // private final int bitsPerPixel;
 
     public PhotometricInterpreterBiLevel(int fBitsPerPixel,
             int fSamplesPerPixel, int fBitsPerSample[], int Predictor,
-            int width, int height, boolean invert)
-    {
+            int width, int height, boolean invert) {
         super(fSamplesPerPixel, fBitsPerSample, Predictor, width, height);
 
         this.invert = invert;
-        //        this.bitsPerPixel = fBitsPerPixel;
+        // this.bitsPerPixel = fBitsPerPixel;
     }
 
     @Override
-    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x, int y)
-            throws ImageReadException, IOException
-    {
+    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x,
+            int y) throws ImageReadException, IOException {
         int sample = samples[0];
 
         if (invert)
@@ -55,4 +52,4 @@ public class PhotometricInterpreterBiLev
 
         imageBuilder.setRGB(x, y, rgb);
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCieLab.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCieLab.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCieLab.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCieLab.java Sat May 26 21:19:03 2012
@@ -22,23 +22,19 @@ import org.apache.commons.imaging.ImageR
 import org.apache.commons.imaging.color.ColorConversions;
 import org.apache.commons.imaging.common.ImageBuilder;
 
-public class PhotometricInterpreterCieLab extends PhotometricInterpreter
-{
+public class PhotometricInterpreterCieLab extends PhotometricInterpreter {
     public PhotometricInterpreterCieLab(int fSamplesPerPixel,
-            int fBitsPerSample[], int Predictor, int width, int height)
-    {
+            int fBitsPerSample[], int Predictor, int width, int height) {
         super(fSamplesPerPixel, fBitsPerSample, Predictor, width, height);
     }
 
     @Override
-    public void dumpstats() throws ImageReadException, IOException
-    {
+    public void dumpstats() throws ImageReadException, IOException {
     }
 
     @Override
-    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x, int y)
-            throws ImageReadException, IOException
-    {
+    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x,
+            int y) throws ImageReadException, IOException {
         int cieL = samples[0];
         int cieA = (byte) samples[1];
         int cieB = (byte) samples[2];
@@ -47,4 +43,4 @@ public class PhotometricInterpreterCieLa
         imageBuilder.setRGB(x, y, rgb);
     }
 
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCmyk.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCmyk.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCmyk.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCmyk.java Sat May 26 21:19:03 2012
@@ -22,18 +22,15 @@ import org.apache.commons.imaging.ImageR
 import org.apache.commons.imaging.color.ColorConversions;
 import org.apache.commons.imaging.common.ImageBuilder;
 
-public class PhotometricInterpreterCmyk extends PhotometricInterpreter
-{
+public class PhotometricInterpreterCmyk extends PhotometricInterpreter {
     public PhotometricInterpreterCmyk(int fSamplesPerPixel,
-            int fBitsPerSample[], int Predictor, int width, int height)
-    {
+            int fBitsPerSample[], int Predictor, int width, int height) {
         super(fSamplesPerPixel, fBitsPerSample, Predictor, width, height);
     }
 
     @Override
-    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x, int y)
-            throws ImageReadException, IOException
-    {
+    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x,
+            int y) throws ImageReadException, IOException {
 
         int sc = samples[0];
         int sm = samples[1];
@@ -44,4 +41,4 @@ public class PhotometricInterpreterCmyk 
         imageBuilder.setRGB(x, y, rgb);
     }
 
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLuv.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLuv.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLuv.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLuv.java Sat May 26 21:19:03 2012
@@ -21,35 +21,30 @@ import java.io.IOException;
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.common.ImageBuilder;
 
-public class PhotometricInterpreterLogLuv extends PhotometricInterpreter
-{
-    //    private final boolean yOnly;
+public class PhotometricInterpreterLogLuv extends PhotometricInterpreter {
+    // private final boolean yOnly;
 
     public PhotometricInterpreterLogLuv(int fSamplesPerPixel,
             int fBitsPerSample[], int Predictor, int width, int height,
-            boolean yonly)
-    {
+            boolean yonly) {
         super(fSamplesPerPixel, fBitsPerSample, Predictor, width, height);
 
-        //        this.yOnly = yonly;
+        // this.yOnly = yonly;
     }
 
     @Override
-    public void dumpstats() throws ImageReadException, IOException
-    {
+    public void dumpstats() throws ImageReadException, IOException {
     }
 
-    private float cube(float f)
-    {
+    private float cube(float f) {
         return f * f * f;
     }
 
-    //        private float function_f(float value, )
+    // private float function_f(float value, )
 
     @Override
-    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x, int y)
-            throws ImageReadException, IOException
-    {
+    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x,
+            int y) throws ImageReadException, IOException {
         float X, Y, Z;
 
         int cieL = samples[0];
@@ -85,21 +80,21 @@ public class PhotometricInterpreterLogLu
             float ref_Y = 100.000f;
             float ref_Z = 108.883f;
 
-            X = ref_X * var_X; //ref_X =  95.047  Observer= 2°, Illuminant= D65
-            Y = ref_Y * var_Y; //ref_Y = 100.000
-            Z = ref_Z * var_Z; //ref_Z = 108.883
+            X = ref_X * var_X; // ref_X = 95.047 Observer= 2°, Illuminant= D65
+            Y = ref_Y * var_Y; // ref_Y = 100.000
+            Z = ref_Z * var_Z; // ref_Z = 108.883
 
         }
 
-        //            ref_X =  95.047        //Observer = 2°, Illuminant = D65
-        //            ref_Y = 100.000
-        //            ref_Z = 108.883
+        // ref_X = 95.047 //Observer = 2°, Illuminant = D65
+        // ref_Y = 100.000
+        // ref_Z = 108.883
 
         int R, G, B;
         {
-            float var_X = X / 100f; //X = From 0 to ref_X
-            float var_Y = Y / 100f; //Y = From 0 to ref_Y
-            float var_Z = Z / 100f; //Z = From 0 to ref_Y
+            float var_X = X / 100f; // X = From 0 to ref_X
+            float var_Y = Y / 100f; // Y = From 0 to ref_Y
+            float var_Z = Z / 100f; // Z = From 0 to ref_Y
 
             float var_R = var_X * 3.2406f + var_Y * -1.5372f + var_Z * -0.4986f;
             float var_G = var_X * -0.9689f + var_Y * 1.8758f + var_Z * 0.0415f;
@@ -119,27 +114,27 @@ public class PhotometricInterpreterLogLu
             else
                 var_B = 12.92f * var_B;
 
-            //                var_R = (((var_R-)))
-            //                updateMaxMin(new float[]{
-            //                        var_R, var_G, var_B,
-            //                }, maxVarRGB, minVarRGB);
-
-            //                var_R = ((var_R + 0.16561039f) / (3.0152583f + 0.16561039f));
-            //                var_G = ((var_G + 0.06561642f) / (3.0239854f + 0.06561642f));
-            //                var_B = ((var_B + 0.19393992f) / (3.1043448f + 0.19393992f));
+            // var_R = (((var_R-)))
+            // updateMaxMin(new float[]{
+            // var_R, var_G, var_B,
+            // }, maxVarRGB, minVarRGB);
+
+            // var_R = ((var_R + 0.16561039f) / (3.0152583f + 0.16561039f));
+            // var_G = ((var_G + 0.06561642f) / (3.0239854f + 0.06561642f));
+            // var_B = ((var_B + 0.19393992f) / (3.1043448f + 0.19393992f));
 
             R = (int) (var_R * 255f);
             G = (int) (var_G * 255f);
             B = (int) (var_B * 255f);
         }
 
-        //            float R = 1.910f * X - 0.532f * Y - 0.288f * Z;
-        //            float G = -0.985f * X + 1.999f * Y - 0.028f * Z;
-        //            float B = 0.058f * X - 0.118f * Y + 0.898f * Z;
-
-        //            updateMaxMin(new float[]{
-        //                    R, G, B,
-        //            }, maxRGB, minRGB);
+        // float R = 1.910f * X - 0.532f * Y - 0.288f * Z;
+        // float G = -0.985f * X + 1.999f * Y - 0.028f * Z;
+        // float B = 0.058f * X - 0.118f * Y + 0.898f * Z;
+
+        // updateMaxMin(new float[]{
+        // R, G, B,
+        // }, maxRGB, minRGB);
 
         int red = R;
         int green = G;
@@ -153,4 +148,4 @@ public class PhotometricInterpreterLogLu
         imageBuilder.setRGB(x, y, rgb);
 
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterPalette.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterPalette.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterPalette.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterPalette.java Sat May 26 21:19:03 2012
@@ -21,21 +21,18 @@ import java.io.IOException;
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.common.ImageBuilder;
 
-public class PhotometricInterpreterPalette extends PhotometricInterpreter
-{
+public class PhotometricInterpreterPalette extends PhotometricInterpreter {
     private final int[] fColorMap;
-    
-    /** 
-     * The color map of integer ARGB values tied to the 
-     * pixel index of the palette
+
+    /**
+     * The color map of integer ARGB values tied to the pixel index of the
+     * palette
      */
     private final int[] indexColorMap;
 
-
     public PhotometricInterpreterPalette(int fSamplesPerPixel,
             int fBitsPerSample[], int Predictor, int width, int height,
-            int[] fColorMap)
-    {
+            int[] fColorMap) {
         super(fSamplesPerPixel, fBitsPerSample, Predictor, width, height);
 
         this.fColorMap = fColorMap;
@@ -43,22 +40,19 @@ public class PhotometricInterpreterPalet
         int fBitsPerPixel = bitsPerSample[0];
         int colormap_scale = (1 << fBitsPerPixel);
         indexColorMap = new int[colormap_scale];
-        for (int index = 0; index < colormap_scale; index++)
-        {
-            int red   = (fColorMap[index]>>8)&0xff;
-            int green = (fColorMap[index + (colormap_scale)]>>8)&0xff;
-            int blue  = (fColorMap[index + (2 * colormap_scale)]>>8)&0xff;
-            indexColorMap[index] =
-                    0xff000000 | (red << 16) | (green << 8) | blue;
+        for (int index = 0; index < colormap_scale; index++) {
+            int red = (fColorMap[index] >> 8) & 0xff;
+            int green = (fColorMap[index + (colormap_scale)] >> 8) & 0xff;
+            int blue = (fColorMap[index + (2 * colormap_scale)] >> 8) & 0xff;
+            indexColorMap[index] = 0xff000000 | (red << 16) | (green << 8)
+                    | blue;
         }
 
-
     }
 
     @Override
-    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x, int y)
-            throws ImageReadException, IOException
-    {
+    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x,
+            int y) throws ImageReadException, IOException {
         imageBuilder.setRGB(x, y, indexColorMap[samples[0]]);
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterRgb.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterRgb.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterRgb.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterRgb.java Sat May 26 21:19:03 2012
@@ -21,18 +21,15 @@ import java.io.IOException;
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.common.ImageBuilder;
 
-public class PhotometricInterpreterRgb extends PhotometricInterpreter
-{
+public class PhotometricInterpreterRgb extends PhotometricInterpreter {
     public PhotometricInterpreterRgb(int fSamplesPerPixel,
-            int fBitsPerSample[], int Predictor, int width, int height)
-    {
+            int fBitsPerSample[], int Predictor, int width, int height) {
         super(fSamplesPerPixel, fBitsPerSample, Predictor, width, height);
     }
 
     @Override
-    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x, int y)
-            throws ImageReadException, IOException
-    {
+    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x,
+            int y) throws ImageReadException, IOException {
         int red = samples[0];
         int green = samples[1];
         int blue = samples[2];
@@ -42,4 +39,4 @@ public class PhotometricInterpreterRgb e
         imageBuilder.setRGB(x, y, rgb);
 
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterYCbCr.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterYCbCr.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterYCbCr.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterYCbCr.java Sat May 26 21:19:03 2012
@@ -21,39 +21,39 @@ import java.io.IOException;
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.common.ImageBuilder;
 
-public class PhotometricInterpreterYCbCr extends PhotometricInterpreter
-{
+public class PhotometricInterpreterYCbCr extends PhotometricInterpreter {
 
     public PhotometricInterpreterYCbCr(double[] fYCbCrCoefficients,
             int[] fYCbCrPositioning, int[] fYCbCrSubSampling,
             double[] fReferenceBlackWhite, int fSamplesPerPixel,
-            int fBitsPerSample[], int Predictor, int width, int height)
-    {
+            int fBitsPerSample[], int Predictor, int width, int height) {
         super(fSamplesPerPixel, fBitsPerSample, Predictor, width, height);
     }
 
-    public int limit(int value, int min, int max)
-    {
+    public int limit(int value, int min, int max) {
         return Math.min(max, Math.max(min, value));
     }
 
     /**
      * This method converts a YUV (aka YCbCr) colorspace to a RGB colorspace.
-     * This is handy when trying to reconstruct an image in Java from YCbCr transmitted
-     * data. This routine expects the data to fall in the standard PC 0..255 range
-     * per pixel, with the array dimensions corresponding to the imageWidth and imageHeight.
-     * These variables are either set manually in the case of a null constructor,
-     * or they are automatically calculated from the image parameter constructor.
-     * @param Y The Y component set.
-     * @param Cb The Cb component set.
-     * @param Cr The Cr component set.
+     * This is handy when trying to reconstruct an image in Java from YCbCr
+     * transmitted data. This routine expects the data to fall in the standard
+     * PC 0..255 range per pixel, with the array dimensions corresponding to the
+     * imageWidth and imageHeight. These variables are either set manually in
+     * the case of a null constructor, or they are automatically calculated from
+     * the image parameter constructor.
+     * 
+     * @param Y
+     *            The Y component set.
+     * @param Cb
+     *            The Cb component set.
+     * @param Cr
+     *            The Cr component set.
      * @return R The R component.
      */
-    public int convertYCbCrtoRGB(int Y, int Cb, int Cr)
-    {
+    public int convertYCbCrtoRGB(int Y, int Cb, int Cr) {
         double r1 = (((1.164 * (Y - 16.0))) + (1.596 * (Cr - 128.0)));
-        double g1 = (((1.164 * (Y - 16.0)))
-                - (0.813 * (Cr - 128.0)) - (0.392 * (Cb - 128.0)));
+        double g1 = (((1.164 * (Y - 16.0))) - (0.813 * (Cr - 128.0)) - (0.392 * (Cb - 128.0)));
         double b1 = (((1.164 * (Y - 16.0))) + (2.017 * (Cb - 128.0)));
 
         int r = limit((int) r1, 0, 255);
@@ -66,9 +66,8 @@ public class PhotometricInterpreterYCbCr
     }
 
     @Override
-    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x, int y)
-            throws ImageReadException, IOException
-    {
+    public void interpretPixel(ImageBuilder imageBuilder, int samples[], int x,
+            int y) throws ImageReadException, IOException {
         int Y = samples[0];
         int Cb = samples[1];
         int Cr = samples[2];
@@ -85,4 +84,4 @@ public class PhotometricInterpreterYCbCr
         imageBuilder.setRGB(x, y, rgb);
 
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfo.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfo.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfo.java Sat May 26 21:19:03 2012
@@ -17,7 +17,6 @@
 
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -31,30 +30,29 @@ import org.apache.commons.imaging.format
 import org.apache.commons.imaging.formats.tiff.constants.TiffFieldTypeConstants;
 import org.apache.commons.imaging.formats.tiff.fieldtypes.FieldType;
 
-public abstract class TagInfo implements TiffDirectoryConstants, TiffFieldTypeConstants
-{
+public abstract class TagInfo implements TiffDirectoryConstants,
+        TiffFieldTypeConstants {
     public static final int LENGTH_UNKNOWN = -1;
 
     public TagInfo(String name, int tag, FieldType dataType, int length,
-            TiffDirectoryType exifDirectory)
-    {
+            TiffDirectoryType exifDirectory) {
         this(name, tag, Arrays.asList(dataType), length, exifDirectory);
     }
 
     public TagInfo(String name, int tag, FieldType dataType, int length,
-            TiffDirectoryType exifDirectory, boolean isOffset)
-    {
-        this(name, tag, Arrays.asList(dataType), length, exifDirectory, isOffset);
+            TiffDirectoryType exifDirectory, boolean isOffset) {
+        this(name, tag, Arrays.asList(dataType), length, exifDirectory,
+                isOffset);
     }
 
-    public TagInfo(String name, int tag, FieldType dataType, int length)
-    {
-        this(name, tag, Arrays.asList(dataType), length, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
+    public TagInfo(String name, int tag, FieldType dataType, int length) {
+        this(name, tag, Arrays.asList(dataType), length,
+                TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
     }
 
-    public TagInfo(String name, int tag, FieldType dataType)
-    {
-        this(name, tag, dataType, LENGTH_UNKNOWN, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
+    public TagInfo(String name, int tag, FieldType dataType) {
+        this(name, tag, dataType, LENGTH_UNKNOWN,
+                TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
     }
 
     public final String name;
@@ -65,53 +63,46 @@ public abstract class TagInfo implements
     private final boolean isOffset;
 
     public TagInfo(String name, int tag, List<FieldType> dataTypes, int length,
-            TiffDirectoryType exifDirectory)
-    {
+            TiffDirectoryType exifDirectory) {
         this(name, tag, dataTypes, length, exifDirectory, false);
     }
 
     public TagInfo(String name, int tag, List<FieldType> dataTypes, int length,
-            TiffDirectoryType exifDirectory, boolean isOffset)
-    {
+            TiffDirectoryType exifDirectory, boolean isOffset) {
         this.name = name;
         this.tag = tag;
-        this.dataTypes = Collections.unmodifiableList(new ArrayList<FieldType>(dataTypes));
+        this.dataTypes = Collections.unmodifiableList(new ArrayList<FieldType>(
+                dataTypes));
         this.length = length;
         this.directoryType = exifDirectory;
         this.isOffset = isOffset;
     }
-    
-    public Object getValue(TiffField entry) throws ImageReadException
-    {
+
+    public Object getValue(TiffField entry) throws ImageReadException {
         Object o = entry.fieldType.getSimpleValue(entry);
         return o;
     }
 
     public byte[] encodeValue(FieldType fieldType, Object value, int byteOrder)
-            throws ImageWriteException
-    {
+            throws ImageWriteException {
         return fieldType.writeData(value, byteOrder);
     }
 
-    public String getDescription()
-    {
+    public String getDescription() {
         return tag + " (0x" + Integer.toHexString(tag) + ": " + name + "): ";
     }
 
     @Override
-    public String toString()
-    {
+    public String toString() {
         return "[TagInfo. tag: " + tag + " (0x" + Integer.toHexString(tag)
                 + ", name: " + name + "]";
     }
 
-    public boolean isOffset()
-    {
+    public boolean isOffset() {
         return isOffset;
     }
 
-    public boolean isText()
-    {
+    public boolean isText() {
         return false;
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAny.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAny.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAny.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAny.java Sat May 26 21:19:03 2012
@@ -19,7 +19,8 @@ package org.apache.commons.imaging.forma
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
 
 public class TagInfoAny extends TagInfo {
-    public TagInfoAny(String name, int tag, int length, TiffDirectoryType directoryType) {
+    public TagInfoAny(String name, int tag, int length,
+            TiffDirectoryType directoryType) {
         super(name, tag, FIELD_TYPE_ANY, length, directoryType);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAscii.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAscii.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAscii.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAscii.java Sat May 26 21:19:03 2012
@@ -22,10 +22,11 @@ import org.apache.commons.imaging.ImageW
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
 
 public class TagInfoAscii extends TagInfo {
-    public TagInfoAscii(String name, int tag, int length, TiffDirectoryType directoryType) {
+    public TagInfoAscii(String name, int tag, int length,
+            TiffDirectoryType directoryType) {
         super(name, tag, FIELD_TYPE_ASCII, length, directoryType);
     }
-    
+
     public String[] getValue(int byteOrder, byte[] bytes) {
         int nullCount = 1;
         for (int i = 0; i < bytes.length - 1; i++) {
@@ -43,7 +44,8 @@ public class TagInfoAscii extends TagInf
         for (int i = 0; i < bytes.length; i++) {
             if (bytes[i] == 0) {
                 try {
-                    String string = new String(bytes, nextStringPos, i - nextStringPos, "UTF-8");
+                    String string = new String(bytes, nextStringPos, i
+                            - nextStringPos, "UTF-8");
                     strings[stringsAdded++] = string;
                 } catch (UnsupportedEncodingException unsupportedEncoding) {
                 }
@@ -53,7 +55,8 @@ public class TagInfoAscii extends TagInf
         if (nextStringPos < bytes.length) {
             // Buggy file, string wasn't null terminated
             try {
-                String string = new String(bytes, nextStringPos, bytes.length - nextStringPos, "UTF-8");
+                String string = new String(bytes, nextStringPos, bytes.length
+                        - nextStringPos, "UTF-8");
                 strings[stringsAdded++] = string;
             } catch (UnsupportedEncodingException unsupportedEncoding) {
             }
@@ -61,7 +64,8 @@ public class TagInfoAscii extends TagInf
         return strings;
     }
 
-    public byte[] encodeValue(int byteOrder, String... values) throws ImageWriteException {
+    public byte[] encodeValue(int byteOrder, String... values)
+            throws ImageWriteException {
         return FIELD_TYPE_ASCII.writeData(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAsciiOrByte.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAsciiOrByte.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAsciiOrByte.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAsciiOrByte.java Sat May 26 21:19:03 2012
@@ -19,7 +19,9 @@ package org.apache.commons.imaging.forma
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
 
 public class TagInfoAsciiOrByte extends TagInfo {
-    public TagInfoAsciiOrByte(String name, int tag, int length, TiffDirectoryType directoryType) {
-        super(name, tag, FIELD_TYPE_DESCRIPTION_ASCII_OR_BYTE, length, directoryType, false);
+    public TagInfoAsciiOrByte(String name, int tag, int length,
+            TiffDirectoryType directoryType) {
+        super(name, tag, FIELD_TYPE_DESCRIPTION_ASCII_OR_BYTE, length,
+                directoryType, false);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAsciiOrRational.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAsciiOrRational.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAsciiOrRational.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoAsciiOrRational.java Sat May 26 21:19:03 2012
@@ -19,7 +19,9 @@ package org.apache.commons.imaging.forma
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
 
 public class TagInfoAsciiOrRational extends TagInfo {
-    public TagInfoAsciiOrRational(String name, int tag, int length, TiffDirectoryType directoryType) {
-        super(name, tag, FIELD_TYPE_DESCRIPTION_ASCII_OR_RATIONAL, length, directoryType, false);
+    public TagInfoAsciiOrRational(String name, int tag, int length,
+            TiffDirectoryType directoryType) {
+        super(name, tag, FIELD_TYPE_DESCRIPTION_ASCII_OR_RATIONAL, length,
+                directoryType, false);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoGpsText.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoGpsText.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoGpsText.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoGpsText.java Sat May 26 21:19:03 2012
@@ -27,34 +27,29 @@ import org.apache.commons.imaging.format
 import org.apache.commons.imaging.formats.tiff.fieldtypes.FieldType;
 import org.apache.commons.imaging.util.Debug;
 
-public final class TagInfoGpsText extends TagInfo
-{
+public final class TagInfoGpsText extends TagInfo {
     public TagInfoGpsText(String name, int tag, FieldType dataType, int length,
-            TiffDirectoryType exifDirectory)
-    {
+            TiffDirectoryType exifDirectory) {
         super(name, tag, dataType, length, exifDirectory);
     }
 
     @Override
-    public boolean isText()
-    {
+    public boolean isText() {
         return true;
     }
 
-    private static final class TextEncoding
-    {
+    private static final class TextEncoding {
         public final byte prefix[];
         public final String encodingNameLE;
         public final String encodingNameBE;
 
         public TextEncoding(final byte[] prefix, final String encodingNameLE,
-                final String encodingNameBE)
-        {
+                final String encodingNameBE) {
             this.prefix = prefix;
             this.encodingNameLE = encodingNameLE;
             this.encodingNameBE = encodingNameBE;
         }
-        
+
         public String getEncodingName(int byteOrder) {
             if (byteOrder == BinaryConstants.BYTE_ORDER_BIG_ENDIAN) {
                 return encodingNameBE;
@@ -65,21 +60,17 @@ public final class TagInfoGpsText extend
     }
 
     private static final TagInfoGpsText.TextEncoding TEXT_ENCODING_ASCII = new TextEncoding(
-            new byte[]{
-                    0x41, 0x53, 0x43, 0x49, 0x49, 0x00, 0x00, 0x00,
-            }, "US-ASCII", "US-ASCII"); // ITU-T T.50 IA5
+            new byte[] { 0x41, 0x53, 0x43, 0x49, 0x49, 0x00, 0x00, 0x00, },
+            "US-ASCII", "US-ASCII"); // ITU-T T.50 IA5
     private static final TagInfoGpsText.TextEncoding TEXT_ENCODING_JIS = new TextEncoding(
-            new byte[]{
-                    0x4A, 0x49, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00,
-            }, "JIS", "JIS"); // JIS X208-1990
+            new byte[] { 0x4A, 0x49, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, },
+            "JIS", "JIS"); // JIS X208-1990
     private static final TagInfoGpsText.TextEncoding TEXT_ENCODING_UNICODE = new TextEncoding(
-            new byte[]{
-                    0x55, 0x4E, 0x49, 0x43, 0x4F, 0x44, 0x45, 0x00,
+            new byte[] { 0x55, 0x4E, 0x49, 0x43, 0x4F, 0x44, 0x45, 0x00,
             // Which Unicode encoding to use, UTF-8?
             }, "UTF-16LE", "UTF-16BE"); // Unicode Standard
     private static final TagInfoGpsText.TextEncoding TEXT_ENCODING_UNDEFINED = new TextEncoding(
-            new byte[]{
-                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+            new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
             // Try to interpret an undefined text as ISO-8859-1 (Latin)
             }, "ISO-8859-1", "ISO-8859-1"); // Undefined
     private static final TagInfoGpsText.TextEncoding TEXT_ENCODINGS[] = {
@@ -90,57 +81,48 @@ public final class TagInfoGpsText extend
     };
 
     @Override
-    public byte[] encodeValue(FieldType fieldType, Object value,
-            int byteOrder) throws ImageWriteException
-    {
+    public byte[] encodeValue(FieldType fieldType, Object value, int byteOrder)
+            throws ImageWriteException {
         if (!(value instanceof String))
             throw new ImageWriteException("GPS text value not String: " + value
                     + " (" + Debug.getType(value) + ")");
         String s = (String) value;
 
-        try
-        {
+        try {
             // try ASCII, with NO prefix.
-            byte asciiBytes[] = s
-                    .getBytes(TEXT_ENCODING_ASCII.getEncodingName(byteOrder));
+            byte asciiBytes[] = s.getBytes(TEXT_ENCODING_ASCII
+                    .getEncodingName(byteOrder));
             String decodedAscii = new String(asciiBytes,
                     TEXT_ENCODING_ASCII.getEncodingName(byteOrder));
-            if (decodedAscii.equals(s))
-            {
+            if (decodedAscii.equals(s)) {
                 // no unicode/non-ascii values.
                 byte result[] = new byte[asciiBytes.length
                         + TEXT_ENCODING_ASCII.prefix.length];
                 System.arraycopy(TEXT_ENCODING_ASCII.prefix, 0, result, 0,
                         TEXT_ENCODING_ASCII.prefix.length);
                 System.arraycopy(asciiBytes, 0, result,
-                        TEXT_ENCODING_ASCII.prefix.length,
-                        asciiBytes.length);
+                        TEXT_ENCODING_ASCII.prefix.length, asciiBytes.length);
                 return result;
-            }
-            else
-            {
+            } else {
                 // use unicode
-                byte unicodeBytes[] = s
-                        .getBytes(TEXT_ENCODING_UNICODE.getEncodingName(byteOrder));
+                byte unicodeBytes[] = s.getBytes(TEXT_ENCODING_UNICODE
+                        .getEncodingName(byteOrder));
                 byte result[] = new byte[unicodeBytes.length
                         + TEXT_ENCODING_UNICODE.prefix.length];
-                System.arraycopy(TEXT_ENCODING_UNICODE.prefix, 0, result,
-                        0, TEXT_ENCODING_UNICODE.prefix.length);
+                System.arraycopy(TEXT_ENCODING_UNICODE.prefix, 0, result, 0,
+                        TEXT_ENCODING_UNICODE.prefix.length);
                 System.arraycopy(unicodeBytes, 0, result,
                         TEXT_ENCODING_UNICODE.prefix.length,
                         unicodeBytes.length);
                 return result;
             }
-        }
-        catch (UnsupportedEncodingException e)
-        {
+        } catch (UnsupportedEncodingException e) {
             throw new ImageWriteException(e.getMessage(), e);
         }
     }
 
     @Override
-    public String getValue(TiffField entry) throws ImageReadException
-    {
+    public String getValue(TiffField entry) throws ImageReadException {
         if (entry.type == FIELD_TYPE_ASCII.type) {
             Object object = FIELD_TYPE_ASCII.getSimpleValue(entry);
             if (object instanceof String) {
@@ -168,48 +150,36 @@ public final class TagInfoGpsText extend
         }
 
         byte bytes[] = entry.fieldType.getRawBytes(entry);
-        if (bytes.length < 8)
-        {
-            try
-            {
+        if (bytes.length < 8) {
+            try {
                 // try ASCII, with NO prefix.
                 return new String(bytes, "US-ASCII");
-            }
-            catch (UnsupportedEncodingException e)
-            {
+            } catch (UnsupportedEncodingException e) {
                 throw new ImageReadException(
                         "GPS text field missing encoding prefix.");
             }
         }
 
-        for (int i = 0; i < TEXT_ENCODINGS.length; i++)
-        {
+        for (int i = 0; i < TEXT_ENCODINGS.length; i++) {
             TagInfoGpsText.TextEncoding encoding = TEXT_ENCODINGS[i];
-            if (BinaryFileFunctions.compareBytes(bytes, 0, encoding.prefix,
-                    0, encoding.prefix.length))
-            {
-                try
-                {
+            if (BinaryFileFunctions.compareBytes(bytes, 0, encoding.prefix, 0,
+                    encoding.prefix.length)) {
+                try {
                     return new String(bytes, encoding.prefix.length,
                             bytes.length - encoding.prefix.length,
                             encoding.getEncodingName(entry.byteOrder));
-                }
-                catch (UnsupportedEncodingException e)
-                {
+                } catch (UnsupportedEncodingException e) {
                     throw new ImageReadException(e.getMessage(), e);
                 }
             }
         }
 
-        try
-        {
+        try {
             // try ASCII, with NO prefix.
             return new String(bytes, "US-ASCII");
-        }
-        catch (UnsupportedEncodingException e)
-        {
+        } catch (UnsupportedEncodingException e) {
             throw new ImageReadException("Unknown GPS text encoding prefix.");
         }
 
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoUnknown.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoUnknown.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoUnknown.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoUnknown.java Sat May 26 21:19:03 2012
@@ -28,4 +28,4 @@ public final class TagInfoUnknown extend
     public boolean isUnknown() {
         return true;
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoXpString.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoXpString.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoXpString.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoXpString.java Sat May 26 21:19:03 2012
@@ -27,18 +27,19 @@ import org.apache.commons.imaging.format
 import org.apache.commons.imaging.util.Debug;
 
 /**
- * Windows XP onwards store some tags using UTF-16LE, but the field type is byte -
- * here we deal with this.
+ * Windows XP onwards store some tags using UTF-16LE, but the field type is byte
+ * - here we deal with this.
  */
 public class TagInfoXpString extends TagInfo {
-    public TagInfoXpString(String name, int tag, int length, TiffDirectoryType directoryType) {
-        super(name, tag, Arrays.asList(FIELD_TYPE_UNDEFINED), length, directoryType);
+    public TagInfoXpString(String name, int tag, int length,
+            TiffDirectoryType directoryType) {
+        super(name, tag, Arrays.asList(FIELD_TYPE_UNDEFINED), length,
+                directoryType);
     }
-    
+
     @Override
-    public byte[] encodeValue(FieldType fieldType, Object value,
-            int byteOrder) throws ImageWriteException
-    {
+    public byte[] encodeValue(FieldType fieldType, Object value, int byteOrder)
+            throws ImageWriteException {
         if (!(value instanceof String))
             throw new ImageWriteException("Text value not String: " + value
                     + " (" + Debug.getType(value) + ")");
@@ -49,7 +50,7 @@ public class TagInfoXpString extends Tag
             return null;
         }
     }
-    
+
     @Override
     public String getValue(TiffField entry) throws ImageReadException {
         if (entry.type != FIELD_TYPE_BYTE.type) {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/ImageDataOffsets.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/ImageDataOffsets.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/ImageDataOffsets.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/ImageDataOffsets.java Sat May 26 21:19:03 2012
@@ -18,22 +18,19 @@ package org.apache.commons.imaging.forma
 
 import org.apache.commons.imaging.formats.tiff.TiffElement;
 
-class ImageDataOffsets
-{
+class ImageDataOffsets {
     public final int imageDataOffsets[];
     public final TiffOutputField imageDataOffsetsField;
     public final TiffOutputItem outputItems[];
 
     public ImageDataOffsets(final TiffElement.DataElement imageData[],
             final int[] imageDataOffsets,
-            final TiffOutputField imageDataOffsetsField)
-    {
+            final TiffOutputField imageDataOffsetsField) {
         this.imageDataOffsets = imageDataOffsets;
         this.imageDataOffsetsField = imageDataOffsetsField;
 
         outputItems = new TiffOutputItem[imageData.length];
-        for (int i = 0; i < imageData.length; i++)
-        {
+        for (int i = 0; i < imageData.length; i++) {
             TiffOutputItem item = new TiffOutputItem.Value("TIFF image data",
                     imageData[i].data);
             outputItems[i] = item;
@@ -41,4 +38,4 @@ class ImageDataOffsets
 
     }
 
-}
\ No newline at end of file
+}



Mime
View raw message