commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1535193 - in /commons/proper/imaging/trunk: ./ src/main/java/org/apache/commons/imaging/ src/main/java/org/apache/commons/imaging/formats/bmp/ src/main/java/org/apache/commons/imaging/formats/dcx/ src/main/java/org/apache/commons/imaging/f...
Date Wed, 23 Oct 2013 22:04:23 GMT
Author: mbenson
Date: Wed Oct 23 22:04:22 2013
New Revision: 1535193

URL: http://svn.apache.org/r1535193
Log:
[IMAGING-119] Convert ImageFormat from emulated enum to actual Java 5 enum

Modified:
    commons/proper/imaging/trunk/pom.xml
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/ImageFormat.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/Imaging.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/xbm/XbmImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingGuessFormatTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/ImageWriteExample.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/bmp/BmpBaseTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/dcx/DcxBaseTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/gif/GifBaseTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/icns/IcnsBaseTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegBaseTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MicrosoftTagTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pam/PamBaseTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/ConvertPngToGifTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngBaseTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngWriteForceTrueColorText.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/psd/PsdBaseTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/rgbe/RgbeBaseTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffBaseTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffCcittTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/xmp/XmpUpdateTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/RoundtripTest.java

Modified: commons/proper/imaging/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/pom.xml?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/pom.xml (original)
+++ commons/proper/imaging/trunk/pom.xml Wed Oct 23 22:04:22 2013
@@ -310,6 +310,10 @@
       <name>Damjan Jovanovic</name>
       <id>damjan</id>
     </developer>
+    <developer>
+      <name>Matt Benson</name>
+      <id>mbenson</id>
+    </developer>
   </developers>
 
   <contributors>

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/ImageFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/ImageFormat.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/ImageFormat.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/ImageFormat.java Wed Oct 23 22:04:22 2013
@@ -17,112 +17,100 @@
 package org.apache.commons.imaging;
 
 /**
- * Provides a definition for an image format.
+ * Enum of known image formats.
  */
-public class ImageFormat {
-    private final String name;
-    private final String extension;
+//@formatter:off
+public enum ImageFormat {
+    UNKNOWN(false),
+    BMP,
+    DCX,
+    GIF,
+    ICNS,
+    ICO,
+    JBIG2,
+    JPEG,
+    PAM,
+    PSD,
+    PBM,
+    PGM,
+    PNM,
+    PPM,
+    PCX,
+    PNG,
+    RGBE,
+    TGA,
+    TIFF,
+    WBMP,
+    XBM,
+    XPM;
+//@formatter:on
+
+    @Deprecated
     public final boolean actual;
 
-    private ImageFormat(final String name, final boolean actual) {
-        this.name = name;
-        this.extension = name;
+    private ImageFormat(final boolean actual) {
         this.actual = actual;
     }
 
-    private ImageFormat(final String name) {
-        this.name = name;
-        this.extension = name;
-        actual = true;
-    }
-
-    @Override
-    public boolean equals(final Object o) {
-        if (!(o instanceof ImageFormat)) {
-            return false;
-        }
-
-        final ImageFormat other = (ImageFormat) o;
-
-        return other.getName().equals(getName());
-
+    private ImageFormat() {
+        this(true);
     }
 
     public String getName() {
-        return name;
-    }
-    
-    public String getExtension() {
-        return extension;
+        return name();
     }
 
-    @Override
-    public String toString() {
-        return "{" + getName() + ": " + getExtension() + "}";
+    public String getExtension() {
+        return name();
     }
 
-    @Override
-    public int hashCode() {
-        return getName().hashCode();
+    public boolean isActual() {
+        return actual;
     }
 
-    public static final ImageFormat IMAGE_FORMAT_UNKNOWN = new ImageFormat(
-            "UNKNOWN", false);
-    public static final ImageFormat IMAGE_FORMAT_BMP = new ImageFormat("BMP");
-    public static final ImageFormat IMAGE_FORMAT_DCX = new ImageFormat("DCX");
-    public static final ImageFormat IMAGE_FORMAT_GIF = new ImageFormat("GIF");
-    public static final ImageFormat IMAGE_FORMAT_ICNS = new ImageFormat("ICNS");
-    public static final ImageFormat IMAGE_FORMAT_ICO = new ImageFormat("ICO");
-    public static final ImageFormat IMAGE_FORMAT_JBIG2 = new ImageFormat("JBig2");
-    public static final ImageFormat IMAGE_FORMAT_JPEG = new ImageFormat("JPEG");
-    public static final ImageFormat IMAGE_FORMAT_PAM = new ImageFormat("PAM");
-    public static final ImageFormat IMAGE_FORMAT_PSD = new ImageFormat("PSD");
-    public static final ImageFormat IMAGE_FORMAT_PBM = new ImageFormat("PBM");
-    public static final ImageFormat IMAGE_FORMAT_PGM = new ImageFormat("PGM");
-    public static final ImageFormat IMAGE_FORMAT_PNM = new ImageFormat("PNM");
-    public static final ImageFormat IMAGE_FORMAT_PPM = new ImageFormat("PPM");
-    public static final ImageFormat IMAGE_FORMAT_PCX = new ImageFormat("PCX");
-    public static final ImageFormat IMAGE_FORMAT_PNG = new ImageFormat("PNG");
-    public static final ImageFormat IMAGE_FORMAT_RGBE = new ImageFormat("RGBE");
-    public static final ImageFormat IMAGE_FORMAT_TGA = new ImageFormat("TGA");
-    public static final ImageFormat IMAGE_FORMAT_TIFF = new ImageFormat("TIFF");
-    public static final ImageFormat IMAGE_FORMAT_WBMP = new ImageFormat("WBMP");
-    public static final ImageFormat IMAGE_FORMAT_XBM = new ImageFormat("XBM");
-    public static final ImageFormat IMAGE_FORMAT_XPM = new ImageFormat("XPM");
-    
-    
-
-    /**
-     * Gets an array of ImageFormat objects for all supported image
-     * formats.
-     * @return A valid array of ImageFormat objects.
-     */
-    public static ImageFormat[] getAllFormats() {
-        final ImageFormat result[] = {
-                IMAGE_FORMAT_UNKNOWN,
-                IMAGE_FORMAT_BMP,
-                IMAGE_FORMAT_DCX,
-                IMAGE_FORMAT_GIF,
-                IMAGE_FORMAT_ICNS,
-                IMAGE_FORMAT_ICO,
-                IMAGE_FORMAT_JBIG2,
-                IMAGE_FORMAT_JPEG,
-                IMAGE_FORMAT_PNG,
-                IMAGE_FORMAT_PAM,
-                IMAGE_FORMAT_PSD,
-                IMAGE_FORMAT_PBM,
-                IMAGE_FORMAT_PCX,
-                IMAGE_FORMAT_PGM,
-                IMAGE_FORMAT_PNM,
-                IMAGE_FORMAT_PPM,
-                IMAGE_FORMAT_RGBE,
-                IMAGE_FORMAT_TGA,
-                IMAGE_FORMAT_TIFF, 
-                IMAGE_FORMAT_WBMP, 
-                IMAGE_FORMAT_XBM,
-                IMAGE_FORMAT_XPM,
-        };
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_UNKNOWN = UNKNOWN;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_BMP = BMP;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_DCX = DCX;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_GIF = GIF;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_ICNS = ICNS;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_ICO = ICO;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_JBIG2 = JBIG2;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_JPEG = JPEG;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_PAM = PAM;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_PSD = PSD;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_PBM = PBM;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_PGM = PGM;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_PNM = PNM;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_PPM = PPM;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_PCX = PCX;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_PNG = PNG;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_RGBE = RGBE;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_TGA = TGA;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_TIFF = TIFF;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_WBMP = WBMP;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_XBM = XBM;
+    @Deprecated
+    public static final ImageFormat IMAGE_FORMAT_XPM = XPM;
 
-        return result;
-    }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/Imaging.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/Imaging.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/Imaging.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/Imaging.java Wed Oct 23 22:04:22 2013
@@ -223,7 +223,7 @@ public abstract class Imaging implements
             throws ImageReadException, IOException {
         
         if (byteSource==null) {
-            return ImageFormat.IMAGE_FORMAT_UNKNOWN;
+            return ImageFormat.UNKNOWN;
         }
         
         InputStream is = null;
@@ -243,38 +243,38 @@ public abstract class Imaging implements
             final int bytePair[] = { b1, b2, };
 
             if (compareBytePair(MAGIC_NUMBERS_GIF, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_GIF;
+                return ImageFormat.GIF;
             }
             // else if (b1 == 0x00 && b2 == 0x00) // too similar to TGA
             // {
             // return ImageFormat.IMAGE_FORMAT_ICO;
             // }
             else if (compareBytePair(MAGIC_NUMBERS_PNG, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_PNG;
+                return ImageFormat.PNG;
             } else if (compareBytePair(MAGIC_NUMBERS_JPEG, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_JPEG;
+                return ImageFormat.JPEG;
             } else if (compareBytePair(MAGIC_NUMBERS_BMP, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_BMP;
+                return ImageFormat.BMP;
             } else if (compareBytePair(MAGIC_NUMBERS_TIFF_MOTOROLA, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_TIFF;
+                return ImageFormat.TIFF;
             } else if (compareBytePair(MAGIC_NUMBERS_TIFF_INTEL, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_TIFF;
+                return ImageFormat.TIFF;
             } else if (compareBytePair(MAGIC_NUMBERS_PSD, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_PSD;
+                return ImageFormat.PSD;
             } else if (compareBytePair(MAGIC_NUMBERS_PAM, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_PAM;
+                return ImageFormat.PAM;
             } else if (compareBytePair(MAGIC_NUMBERS_PBM_A, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_PBM;
+                return ImageFormat.PBM;
             } else if (compareBytePair(MAGIC_NUMBERS_PBM_B, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_PBM;
+                return ImageFormat.PBM;
             } else if (compareBytePair(MAGIC_NUMBERS_PGM_A, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_PGM;
+                return ImageFormat.PGM;
             } else if (compareBytePair(MAGIC_NUMBERS_PGM_B, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_PGM;
+                return ImageFormat.PGM;
             } else if (compareBytePair(MAGIC_NUMBERS_PPM_A, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_PPM;
+                return ImageFormat.PPM;
             } else if (compareBytePair(MAGIC_NUMBERS_PPM_B, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_PPM;
+                return ImageFormat.PPM;
             } else if (compareBytePair(MAGIC_NUMBERS_JBIG2_1, bytePair)) {
                 final int i3 = is.read();
                 final int i4 = is.read();
@@ -287,17 +287,17 @@ public abstract class Imaging implements
                 final int b4 = i4 & 0xff;
                 final int bytePair2[] = { b3, b4, };
                 if (compareBytePair(MAGIC_NUMBERS_JBIG2_2, bytePair2)) {
-                    return ImageFormat.IMAGE_FORMAT_JBIG2;
+                    return ImageFormat.JBIG2;
                 }
             } else if (compareBytePair(MAGIC_NUMBERS_ICNS, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_ICNS;
+                return ImageFormat.ICNS;
             } else if (compareBytePair(MAGIC_NUMBERS_DCX, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_DCX;
+                return ImageFormat.DCX;
             } else if (compareBytePair(MAGIC_NUMBERS_RGBE, bytePair)) {
-                return ImageFormat.IMAGE_FORMAT_RGBE;
+                return ImageFormat.RGBE;
             }
 
-            return ImageFormat.IMAGE_FORMAT_UNKNOWN;
+            return ImageFormat.UNKNOWN;
         } finally {
             if (is != null) {
                 try {
@@ -698,7 +698,7 @@ public abstract class Imaging implements
     private static ImageParser getImageParser(final ByteSource byteSource)
             throws ImageReadException, IOException {
         final ImageFormat format = guessFormat(byteSource);
-        if (!format.equals(ImageFormat.IMAGE_FORMAT_UNKNOWN)) {
+        if (!format.equals(ImageFormat.UNKNOWN)) {
 
             final ImageParser imageParsers[] = ImageParser.getAllImageParsers();
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java Wed Oct 23 22:04:22 2013
@@ -80,7 +80,7 @@ public class BmpImageParser extends Imag
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_BMP, //
+        return new ImageFormat[] { ImageFormat.BMP, //
         };
     }
 
@@ -640,7 +640,7 @@ public class BmpImageParser extends Imag
         // TODO: comments...
 
         final int bitsPerPixel = bhi.bitsPerPixel;
-        final ImageFormat format = ImageFormat.IMAGE_FORMAT_BMP;
+        final ImageFormat format = ImageFormat.BMP;
         final String name = "BMP Windows Bitmap";
         final String mimeType = "image/x-ms-bmp";
         // we ought to count images, but don't yet.

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java Wed Oct 23 22:04:22 2013
@@ -71,7 +71,7 @@ public class DcxImageParser extends Imag
     @Override
     protected ImageFormat[] getAcceptedTypes() {
         return new ImageFormat[] {
-                ImageFormat.IMAGE_FORMAT_DCX, //
+                ImageFormat.DCX, //
         };
     }
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java Wed Oct 23 22:04:22 2013
@@ -75,7 +75,7 @@ public class GifImageParser extends Imag
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_GIF, //
+        return new ImageFormat[] { ImageFormat.GIF, //
         };
     }
 
@@ -570,7 +570,7 @@ public class GifImageParser extends Imag
 
         final List<String> comments = getComments(blocks.blocks);
         final int bitsPerPixel = (bhi.colorResolution + 1);
-        final ImageFormat format = ImageFormat.IMAGE_FORMAT_GIF;
+        final ImageFormat format = ImageFormat.GIF;
         final String formatName = "GIF Graphics Interchange Format";
         final String mimeType = "image/gif";
         // we ought to count images, but don't yet.

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java Wed Oct 23 22:04:22 2013
@@ -68,7 +68,7 @@ public class IcnsImageParser extends Ima
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_ICNS };
+        return new ImageFormat[] { ImageFormat.ICNS };
     }
 
     @Override
@@ -107,7 +107,7 @@ public class IcnsImageParser extends Ima
         }
         final BufferedImage image0 = images.get(0);
         return new ImageInfo("Icns", 32, new ArrayList<String>(),
-                ImageFormat.IMAGE_FORMAT_ICNS, "ICNS Apple Icon Image",
+                ImageFormat.ICNS, "ICNS Apple Icon Image",
                 image0.getHeight(), "image/x-icns", images.size(), 0, 0, 0, 0,
                 image0.getWidth(), false, true, false,
                 ImageInfo.COLOR_TYPE_RGB,

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java Wed Oct 23 22:04:22 2013
@@ -73,7 +73,7 @@ public class IcoImageParser extends Imag
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_ICO, //
+        return new ImageFormat[] { ImageFormat.ICO, //
         };
     }
 
@@ -536,7 +536,7 @@ public class IcoImageParser extends Imag
     private IconData readIconData(final byte[] iconData, final IconInfo fIconInfo)
             throws ImageReadException, IOException {
         final ImageFormat imageFormat = Imaging.guessFormat(iconData);
-        if (imageFormat.equals(ImageFormat.IMAGE_FORMAT_PNG)) {
+        if (imageFormat.equals(ImageFormat.PNG)) {
             final BufferedImage bufferedImage = Imaging.getBufferedImage(iconData);
             final PNGIconData pngIconData = new PNGIconData(fIconInfo, bufferedImage);
             return pngIconData;

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java Wed Oct 23 22:04:22 2013
@@ -65,7 +65,7 @@ public class JpegImageParser extends Ima
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_JPEG, //
+        return new ImageFormat[] { ImageFormat.JPEG, //
         };
     }
 
@@ -783,7 +783,7 @@ public class JpegImageParser extends Ima
         final int Precision = fSOFNSegment.precision;
 
         final int BitsPerPixel = Number_of_components * Precision;
-        final ImageFormat Format = ImageFormat.IMAGE_FORMAT_JPEG;
+        final ImageFormat Format = ImageFormat.JPEG;
         final String FormatName = "JPEG (Joint Photographic Experts Group) Format";
         final String MimeType = "image/jpeg";
         // we ought to count images, but don't yet.

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java Wed Oct 23 22:04:22 2013
@@ -83,7 +83,7 @@ public class PcxImageParser extends Imag
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_PCX, //
+        return new ImageFormat[] { ImageFormat.PCX, //
         };
     }
 
@@ -107,7 +107,7 @@ public class PcxImageParser extends Imag
                 "PCX",
                 pcxHeader.nPlanes * pcxHeader.bitsPerPixel,
                 new ArrayList<String>(),
-                ImageFormat.IMAGE_FORMAT_PCX,
+                ImageFormat.PCX,
                 "ZSoft PCX Image",
                 size.height,
                 "image/x-pcx",

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java Wed Oct 23 22:04:22 2013
@@ -89,7 +89,7 @@ public class PngImageParser extends Imag
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_PNG, //
+        return new ImageFormat[] { ImageFormat.PNG, //
         };
     }
 
@@ -567,7 +567,7 @@ public class PngImageParser extends Imag
 
         final int BitsPerPixel = pngChunkIHDR.bitDepth
                 * samplesPerPixel(pngChunkIHDR.colorType);
-        final ImageFormat Format = ImageFormat.IMAGE_FORMAT_PNG;
+        final ImageFormat Format = ImageFormat.PNG;
         final String FormatName = "PNG Portable Network Graphics";
         final int Height = pngChunkIHDR.height;
         final String MimeType = "image/png";

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java Wed Oct 23 22:04:22 2013
@@ -79,7 +79,7 @@ public class PamFileInfo extends FileInf
 
     @Override
     public ImageFormat getImageType() {
-        return ImageFormat.IMAGE_FORMAT_PAM;
+        return ImageFormat.PAM;
     }
 
     @Override

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java Wed Oct 23 22:04:22 2013
@@ -44,7 +44,7 @@ public class PbmFileInfo extends FileInf
 
     @Override
     public ImageFormat getImageType() {
-        return ImageFormat.IMAGE_FORMAT_PBM;
+        return ImageFormat.PBM;
     }
 
     @Override

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java Wed Oct 23 22:04:22 2013
@@ -63,7 +63,7 @@ public class PgmFileInfo extends FileInf
 
     @Override
     public ImageFormat getImageType() {
-        return ImageFormat.IMAGE_FORMAT_PGM;
+        return ImageFormat.PGM;
     }
 
     @Override

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java Wed Oct 23 22:04:22 2013
@@ -71,11 +71,11 @@ public class PnmImageParser extends Imag
     @Override
     protected ImageFormat[] getAcceptedTypes() {
         return new ImageFormat[] {
-                ImageFormat.IMAGE_FORMAT_PBM, //
-                ImageFormat.IMAGE_FORMAT_PGM, //
-                ImageFormat.IMAGE_FORMAT_PPM, //
-                ImageFormat.IMAGE_FORMAT_PNM,
-                ImageFormat.IMAGE_FORMAT_PAM
+                ImageFormat.PBM, //
+                ImageFormat.PGM, //
+                ImageFormat.PPM, //
+                ImageFormat.PNM,
+                ImageFormat.PAM
         };
     }
 
@@ -343,13 +343,13 @@ public class PnmImageParser extends Imag
 
             final Object subtype = params.get(PARAM_KEY_FORMAT);
             if (subtype != null) {
-                if (subtype.equals(ImageFormat.IMAGE_FORMAT_PBM)) {
+                if (subtype.equals(ImageFormat.PBM)) {
                     writer = new PbmWriter(useRawbits);
-                } else if (subtype.equals(ImageFormat.IMAGE_FORMAT_PGM)) {
+                } else if (subtype.equals(ImageFormat.PGM)) {
                     writer = new PgmWriter(useRawbits);
-                } else if (subtype.equals(ImageFormat.IMAGE_FORMAT_PPM)) {
+                } else if (subtype.equals(ImageFormat.PPM)) {
                     writer = new PpmWriter(useRawbits);
-                } else if (subtype.equals(ImageFormat.IMAGE_FORMAT_PAM)) { 
+                } else if (subtype.equals(ImageFormat.PAM)) { 
                     writer = new PamWriter();
                 }
             }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java Wed Oct 23 22:04:22 2013
@@ -63,7 +63,7 @@ public class PpmFileInfo extends FileInf
 
     @Override
     public ImageFormat getImageType() {
-        return ImageFormat.IMAGE_FORMAT_PPM;
+        return ImageFormat.PPM;
     }
 
     @Override

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java Wed Oct 23 22:04:22 2013
@@ -75,7 +75,7 @@ public class PsdImageParser extends Imag
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_PSD, //
+        return new ImageFormat[] { ImageFormat.PSD, //
         };
     }
 
@@ -547,7 +547,7 @@ public class PsdImageParser extends Imag
         if (BitsPerPixel < 0) {
             BitsPerPixel = 0;
         }
-        final ImageFormat Format = ImageFormat.IMAGE_FORMAT_PSD;
+        final ImageFormat Format = ImageFormat.PSD;
         final String FormatName = "Photoshop";
         final String MimeType = "image/x-photoshop";
         // we ought to count images, but don't yet.

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeImageParser.java Wed Oct 23 22:04:22 2013
@@ -67,7 +67,7 @@ public class RgbeImageParser extends Ima
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_RGBE };
+        return new ImageFormat[] { ImageFormat.RGBE };
     }
 
     @Override
@@ -91,7 +91,7 @@ public class RgbeImageParser extends Ima
             return new ImageInfo(
                     getName(),
                     32, // todo may be 64 if double?
-                    new ArrayList<String>(), ImageFormat.IMAGE_FORMAT_RGBE, getName(),
+                    new ArrayList<String>(), ImageFormat.RGBE, getName(),
                     info.getHeight(), "image/vnd.radiance", 1, -1, -1, -1, -1,
                     info.getWidth(), false, false, false,
                     ImageInfo.COLOR_TYPE_RGB, "Adaptive RLE");

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java Wed Oct 23 22:04:22 2013
@@ -79,7 +79,7 @@ public class TiffImageParser extends Ima
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_TIFF, //
+        return new ImageFormat[] { ImageFormat.TIFF, //
         };
     }
 
@@ -255,7 +255,7 @@ public class TiffImageParser extends Ima
             comments.add(comment);
         }
 
-        final ImageFormat format = ImageFormat.IMAGE_FORMAT_TIFF;
+        final ImageFormat format = ImageFormat.TIFF;
         final String formatName = "TIFF Tag-based Image File Format";
         final String mimeType = "image/tiff";
         final int numberOfImages = contents.directories.size();

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java Wed Oct 23 22:04:22 2013
@@ -63,7 +63,7 @@ public class WbmpImageParser extends Ima
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_WBMP, //
+        return new ImageFormat[] { ImageFormat.WBMP, //
         };
     }
 
@@ -83,7 +83,7 @@ public class WbmpImageParser extends Ima
             throws ImageReadException, IOException {
         final WbmpHeader wbmpHeader = readWbmpHeader(byteSource);
         return new ImageInfo("WBMP", 1, new ArrayList<String>(),
-                ImageFormat.IMAGE_FORMAT_WBMP,
+                ImageFormat.WBMP,
                 "Wireless Application Protocol Bitmap", wbmpHeader.height,
                 "image/vnd.wap.wbmp", 1, 0, 0, 0, 0, wbmpHeader.width, false,
                 false, false, ImageInfo.COLOR_TYPE_BW,

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/xbm/XbmImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/xbm/XbmImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/xbm/XbmImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/xbm/XbmImageParser.java Wed Oct 23 22:04:22 2013
@@ -69,7 +69,7 @@ public class XbmImageParser extends Imag
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_XBM, //
+        return new ImageFormat[] { ImageFormat.XBM, //
         };
     }
 
@@ -89,7 +89,7 @@ public class XbmImageParser extends Imag
             throws ImageReadException, IOException {
         final XbmHeader xbmHeader = readXbmHeader(byteSource);
         return new ImageInfo("XBM", 1, new ArrayList<String>(),
-                ImageFormat.IMAGE_FORMAT_XBM, "X BitMap", xbmHeader.height,
+                ImageFormat.XBM, "X BitMap", xbmHeader.height,
                 "image/x-xbitmap", 1, 0, 0, 0, 0, xbmHeader.width, false,
                 false, false, ImageInfo.COLOR_TYPE_BW,
                 ImageInfo.COMPRESSION_ALGORITHM_NONE);

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java Wed Oct 23 22:04:22 2013
@@ -122,7 +122,7 @@ public class XpmImageParser extends Imag
 
     @Override
     protected ImageFormat[] getAcceptedTypes() {
-        return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_XPM, //
+        return new ImageFormat[] { ImageFormat.XPM, //
         };
     }
 
@@ -157,7 +157,7 @@ public class XpmImageParser extends Imag
          }
       }
         return new ImageInfo("XPM version 3", xpmHeader.numCharsPerPixel * 8,
-                new ArrayList<String>(), ImageFormat.IMAGE_FORMAT_XPM,
+                new ArrayList<String>(), ImageFormat.XPM,
                 "X PixMap", xpmHeader.height, "image/x-xpixmap", 1, 0, 0, 0, 0,
                 xpmHeader.width, false, isTransparent, true, colorType,
                 ImageInfo.COMPRESSION_ALGORITHM_NONE);

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingGuessFormatTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingGuessFormatTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingGuessFormatTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingGuessFormatTest.java Wed Oct 23 22:04:22 2013
@@ -38,18 +38,18 @@ public class ImagingGuessFormatTest exte
     public static final String TGA_IMAGE_FILE = "tga\\1\\Oregon Scientific DS6639 - DSC_0307 - small.tga";
 
     public void testGuess_all() throws Exception {
-        testGuess(ImageFormat.IMAGE_FORMAT_PNG, PNG_IMAGE_FILE);
-        testGuess(ImageFormat.IMAGE_FORMAT_GIF, GIF_IMAGE_FILE);
-        testGuess(ImageFormat.IMAGE_FORMAT_ICNS, ICNS_IMAGE_FILE);
+        testGuess(ImageFormat.PNG, PNG_IMAGE_FILE);
+        testGuess(ImageFormat.GIF, GIF_IMAGE_FILE);
+        testGuess(ImageFormat.ICNS, ICNS_IMAGE_FILE);
         // TODO(cmchen): add ability to sniff ICOs if possible.
         // testGuess(ImageFormat.IMAGE_FORMAT_ICO, ICO_IMAGE_FILE);
-        testGuess(ImageFormat.IMAGE_FORMAT_TIFF, TIFF_IMAGE_FILE);
-        testGuess(ImageFormat.IMAGE_FORMAT_JPEG, JPEG_IMAGE_FILE);
-        testGuess(ImageFormat.IMAGE_FORMAT_BMP, BMP_IMAGE_FILE);
-        testGuess(ImageFormat.IMAGE_FORMAT_PSD, PSD_IMAGE_FILE);
-        testGuess(ImageFormat.IMAGE_FORMAT_PBM, PBM_IMAGE_FILE);
-        testGuess(ImageFormat.IMAGE_FORMAT_PGM, PGM_IMAGE_FILE);
-        testGuess(ImageFormat.IMAGE_FORMAT_PPM, PPM_IMAGE_FILE);
+        testGuess(ImageFormat.TIFF, TIFF_IMAGE_FILE);
+        testGuess(ImageFormat.JPEG, JPEG_IMAGE_FILE);
+        testGuess(ImageFormat.BMP, BMP_IMAGE_FILE);
+        testGuess(ImageFormat.PSD, PSD_IMAGE_FILE);
+        testGuess(ImageFormat.PBM, PBM_IMAGE_FILE);
+        testGuess(ImageFormat.PGM, PGM_IMAGE_FILE);
+        testGuess(ImageFormat.PPM, PPM_IMAGE_FILE);
         // TODO(cmchen): add ability to sniff TGAs if possible.
         // testGuess(ImageFormat.IMAGE_FORMAT_TGA, TGA_IMAGE_FILE);
         // TODO(cmchen): Add test images for these formats.
@@ -60,7 +60,7 @@ public class ImagingGuessFormatTest exte
     public static final String UNKNOWN_IMAGE_FILE = "jpg\\1\\info.txt";
 
     public void testGuess_unknown() throws Exception {
-        testGuess(ImageFormat.IMAGE_FORMAT_UNKNOWN, UNKNOWN_IMAGE_FILE);
+        testGuess(ImageFormat.UNKNOWN, UNKNOWN_IMAGE_FILE);
     }
 
     public void testGuess(final ImageFormat expectedFormat, String imagePath)

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java Wed Oct 23 22:04:22 2013
@@ -85,8 +85,8 @@ public class ByteSourceImageTest extends
             checkGetImageSize(imageFile, imageFileBytes);
 
             final ImageFormat imageFormat = Imaging.guessFormat(imageFile);
-            if (ImageFormat.IMAGE_FORMAT_JPEG != imageFormat
-                    && ImageFormat.IMAGE_FORMAT_UNKNOWN != imageFormat) {
+            if (ImageFormat.JPEG != imageFormat
+                    && ImageFormat.UNKNOWN != imageFormat) {
                 checkGetBufferedImage(imageFile, imageFileBytes);
             }
         }
@@ -125,12 +125,12 @@ public class ByteSourceImageTest extends
         // check guessFormat()
         final ImageFormat imageFormatFile = Imaging.guessFormat(imageFile);
         assertNotNull(imageFormatFile);
-        assertTrue(imageFormatFile != ImageFormat.IMAGE_FORMAT_UNKNOWN);
+        assertTrue(imageFormatFile != ImageFormat.UNKNOWN);
         // Debug.debug("imageFormatFile", imageFormatFile);
 
         final ImageFormat imageFormatBytes = Imaging.guessFormat(imageFileBytes);
         assertNotNull(imageFormatBytes);
-        assertTrue(imageFormatBytes != ImageFormat.IMAGE_FORMAT_UNKNOWN);
+        assertTrue(imageFormatBytes != ImageFormat.UNKNOWN);
         // Debug.debug("imageFormatBytes", imageFormatBytes);
 
         assertTrue(imageFormatBytes == imageFormatFile);
@@ -158,8 +158,8 @@ public class ByteSourceImageTest extends
         final Map<String,Object> params = new HashMap<String,Object>();
         final boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
         final ImageFormat imageFormat = Imaging.guessFormat(imageFile);
-        if (imageFormat.equals(ImageFormat.IMAGE_FORMAT_TIFF)
-                || imageFormat.equals(ImageFormat.IMAGE_FORMAT_JPEG)) {
+        if (imageFormat.equals(ImageFormat.TIFF)
+                || imageFormat.equals(ImageFormat.JPEG)) {
             params.put(PARAM_KEY_READ_THUMBNAILS, new Boolean(!ignoreImageData));
         }
 
@@ -198,7 +198,7 @@ public class ByteSourceImageTest extends
         assertTrue(imageInfoFile.getBitsPerPixel() > 0);
 
         assertNotNull(imageInfoFile.getFormat());
-        assertTrue(imageInfoFile.getFormat() != ImageFormat.IMAGE_FORMAT_UNKNOWN);
+        assertTrue(imageInfoFile.getFormat() != ImageFormat.UNKNOWN);
 
         assertNotNull(imageInfoFile.getFormatName());
 

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/ImageWriteExample.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/ImageWriteExample.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/ImageWriteExample.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/ImageWriteExample.java Wed Oct 23 22:04:22 2013
@@ -35,7 +35,7 @@ public class ImageWriteExample {
         // read image
         final BufferedImage image = Imaging.getBufferedImage(file);
 
-        final ImageFormat format = ImageFormat.IMAGE_FORMAT_TIFF;
+        final ImageFormat format = ImageFormat.TIFF;
         final Map<String,Object> params = new HashMap<String,Object>();
 
         // set optional parameters if you like

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java Wed Oct 23 22:04:22 2013
@@ -64,7 +64,7 @@ public class SampleUsage {
             // <b>Write an image. </b>
             final BufferedImage image = someImage;
             final File dst = someFile;
-            final ImageFormat format = ImageFormat.IMAGE_FORMAT_PNG;
+            final ImageFormat format = ImageFormat.PNG;
             final Map<String,Object> optional_params = new HashMap<String,Object>();
             Imaging.writeImage(image, dst, format, optional_params);
 
@@ -92,7 +92,7 @@ public class SampleUsage {
 
             // <b>try to guess the image's format. </b>
             final ImageFormat image_format = Imaging.guessFormat(imageBytes);
-            image_format.equals(ImageFormat.IMAGE_FORMAT_PNG);
+            image_format.equals(ImageFormat.PNG);
 
             // <b>get all metadata stored in EXIF format (ie. from JPEG or
             // TIFF). </b>

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/bmp/BmpBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/bmp/BmpBaseTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/bmp/BmpBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/bmp/BmpBaseTest.java Wed Oct 23 22:04:22 2013
@@ -31,7 +31,7 @@ public abstract class BmpBaseTest extend
     private static boolean isBmp(final File file) throws IOException,
             ImageReadException {
         final ImageFormat format = Imaging.guessFormat(file);
-        return format == ImageFormat.IMAGE_FORMAT_BMP;
+        return format == ImageFormat.BMP;
     }
 
     private static final ImageFilter IMAGE_FILTER = new ImageFilter() {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java Wed Oct 23 22:04:22 2013
@@ -137,7 +137,7 @@ public class BmpRoundtripTest extends Bm
         // Boolean.TRUE);
 
         final byte bytes[] = Imaging.writeImageToBytes(srcImage,
-                ImageFormat.IMAGE_FORMAT_BMP, writeParams);
+                ImageFormat.BMP, writeParams);
 
         // Debug.debug("bytes", bytes);
 

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/dcx/DcxBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/dcx/DcxBaseTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/dcx/DcxBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/dcx/DcxBaseTest.java Wed Oct 23 22:04:22 2013
@@ -31,7 +31,7 @@ public abstract class DcxBaseTest extend
     private static boolean isDcx(final File file) throws IOException,
             ImageReadException {
         final ImageFormat format = Imaging.guessFormat(file);
-        return format == ImageFormat.IMAGE_FORMAT_DCX;
+        return format == ImageFormat.DCX;
     }
 
     private static final ImageFilter IMAGE_FILTER = new ImageFilter() {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/gif/GifBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/gif/GifBaseTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/gif/GifBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/gif/GifBaseTest.java Wed Oct 23 22:04:22 2013
@@ -31,7 +31,7 @@ public abstract class GifBaseTest extend
     private static boolean isGif(final File file) throws IOException,
             ImageReadException {
         final ImageFormat format = Imaging.guessFormat(file);
-        return format == ImageFormat.IMAGE_FORMAT_GIF;
+        return format == ImageFormat.GIF;
     }
 
     private static final ImageFilter IMAGE_FILTER = new ImageFilter() {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/icns/IcnsBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/icns/IcnsBaseTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/icns/IcnsBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/icns/IcnsBaseTest.java Wed Oct 23 22:04:22 2013
@@ -31,7 +31,7 @@ public abstract class IcnsBaseTest exten
     private static boolean isIcns(final File file) throws IOException,
             ImageReadException {
         final ImageFormat format = Imaging.guessFormat(file);
-        return format == ImageFormat.IMAGE_FORMAT_ICNS;
+        return format == ImageFormat.ICNS;
     }
 
     private static final ImageFilter IMAGE_FILTER = new ImageFilter() {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegBaseTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegBaseTest.java Wed Oct 23 22:04:22 2013
@@ -31,7 +31,7 @@ public abstract class JpegBaseTest exten
     protected static boolean isJpeg(final File file) throws IOException,
             ImageReadException {
         final ImageFormat format = Imaging.guessFormat(file);
-        return format == ImageFormat.IMAGE_FORMAT_JPEG;
+        return format == ImageFormat.JPEG;
     }
 
     public static final ImageFilter imageFilter = new ImageFilter() {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MicrosoftTagTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MicrosoftTagTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MicrosoftTagTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MicrosoftTagTest.java Wed Oct 23 22:04:22 2013
@@ -48,7 +48,7 @@ public class MicrosoftTagTest extends Ex
         exif.add(MicrosoftTagConstants.EXIF_TAG_XPTITLE, title);
         final Map<String,Object> params = new TreeMap<String,Object>();
         params.put(TiffConstants.PARAM_KEY_EXIF, exifSet);
-        final byte[] bytes = Imaging.writeImageToBytes(image, ImageFormat.IMAGE_FORMAT_TIFF, params);
+        final byte[] bytes = Imaging.writeImageToBytes(image, ImageFormat.TIFF, params);
         checkFields(bytes);
     }
     

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pam/PamBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pam/PamBaseTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pam/PamBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pam/PamBaseTest.java Wed Oct 23 22:04:22 2013
@@ -31,7 +31,7 @@ public abstract class PamBaseTest extend
     private static boolean isPam(final File file) throws IOException,
             ImageReadException {
         final ImageFormat format = Imaging.guessFormat(file);
-        return format == ImageFormat.IMAGE_FORMAT_PAM;
+        return format == ImageFormat.PAM;
     }
 
     private static final ImageFilter IMAGE_FILTER = new ImageFilter() {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/ConvertPngToGifTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/ConvertPngToGifTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/ConvertPngToGifTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/ConvertPngToGifTest.java Wed Oct 23 22:04:22 2013
@@ -53,7 +53,7 @@ public class ConvertPngToGifTest extends
             final File outFile = createTempFile(imageFile.getName() + ".", ".gif");
             // Debug.debug("outFile", outFile);
 
-            Imaging.writeImage(image, outFile, ImageFormat.IMAGE_FORMAT_GIF,
+            Imaging.writeImage(image, outFile, ImageFormat.GIF,
                     params);
         }
         Debug.debug("complete.");

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngBaseTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngBaseTest.java Wed Oct 23 22:04:22 2013
@@ -31,7 +31,7 @@ public abstract class PngBaseTest extend
     private static boolean isPng(final File file) throws IOException,
             ImageReadException {
         final ImageFormat format = Imaging.guessFormat(file);
-        return format == ImageFormat.IMAGE_FORMAT_PNG;
+        return format == ImageFormat.PNG;
     }
 
     private static final ImageFilter imageFilter = new ImageFilter() {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java Wed Oct 23 22:04:22 2013
@@ -63,7 +63,7 @@ public class PngMultipleRoundtripTest ex
 
                 final Map<String,Object> writeParams = new HashMap<String,Object>();
                 Imaging.writeImage(image, tempFile,
-                        ImageFormat.IMAGE_FORMAT_PNG, writeParams);
+                        ImageFormat.PNG, writeParams);
 
                 lastFile = tempFile;
             }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java Wed Oct 23 22:04:22 2013
@@ -66,7 +66,7 @@ public class PngTextTest extends PngBase
         writeParams.put(PngConstants.PARAM_KEY_PNG_TEXT_CHUNKS, writeTexts);
 
         final byte bytes[] = Imaging.writeImageToBytes(srcImage,
-                ImageFormat.IMAGE_FORMAT_PNG, writeParams);
+                ImageFormat.PNG, writeParams);
 
         final File tempFile = createTempFile("temp", ".png");
         IoUtils.writeToFile(bytes, tempFile);

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngWriteForceTrueColorText.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngWriteForceTrueColorText.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngWriteForceTrueColorText.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngWriteForceTrueColorText.java Wed Oct 23 22:04:22 2013
@@ -61,7 +61,7 @@ public class PngWriteForceTrueColorText 
                 params.put(PngConstants.PARAM_KEY_PNG_FORCE_TRUE_COLOR,
                         Boolean.TRUE);
                 Imaging.writeImage(image, outFile,
-                        ImageFormat.IMAGE_FORMAT_PNG, params);
+                        ImageFormat.PNG, params);
 
                 final BufferedImage image2 = Imaging.getBufferedImage(outFile,
                         new HashMap<String,Object>());

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java Wed Oct 23 22:04:22 2013
@@ -96,7 +96,7 @@ public class PngWriteReadTest extends Im
         final int[][] smallAscendingPixels = getAscendingRawData(256, 256);
         final byte[] pngBytes = Imaging.writeImageToBytes(
                 imageDataToBufferedImage(smallAscendingPixels),
-                ImageFormat.IMAGE_FORMAT_PNG, null);
+                ImageFormat.PNG, null);
         assertTrue(Imaging.getImageInfo(pngBytes).isTransparent());
     }
 
@@ -137,7 +137,7 @@ public class PngWriteReadTest extends Im
         // Boolean.TRUE);
 
         final byte bytes[] = Imaging.writeImageToBytes(srcImage,
-                ImageFormat.IMAGE_FORMAT_PNG, writeParams);
+                ImageFormat.PNG, writeParams);
 
         // Debug.debug("bytes", bytes);
 

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/psd/PsdBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/psd/PsdBaseTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/psd/PsdBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/psd/PsdBaseTest.java Wed Oct 23 22:04:22 2013
@@ -29,7 +29,7 @@ public abstract class PsdBaseTest extend
     private static boolean isPsd(final File file) throws IOException,
             ImageReadException {
         final ImageFormat format = Imaging.guessFormat(file);
-        return format == ImageFormat.IMAGE_FORMAT_PSD;
+        return format == ImageFormat.PSD;
     }
 
     private static final ImageFilter IMAGE_FILTER = new ImageFilter() {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/rgbe/RgbeBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/rgbe/RgbeBaseTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/rgbe/RgbeBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/rgbe/RgbeBaseTest.java Wed Oct 23 22:04:22 2013
@@ -29,7 +29,7 @@ public abstract class RgbeBaseTest exten
     private static boolean isRgbe(final File file) throws IOException,
             ImageReadException {
         final ImageFormat format = Imaging.guessFormat(file);
-        return format == ImageFormat.IMAGE_FORMAT_RGBE;
+        return format == ImageFormat.RGBE;
     }
 
     private static final ImageFilter IMAGE_FILTER = new ImageFilter() {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffBaseTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffBaseTest.java Wed Oct 23 22:04:22 2013
@@ -31,7 +31,7 @@ public abstract class TiffBaseTest exten
     private static boolean isTiff(final File file) throws IOException,
             ImageReadException {
         final ImageFormat format = Imaging.guessFormat(file);
-        return format == ImageFormat.IMAGE_FORMAT_TIFF;
+        return format == ImageFormat.TIFF;
     }
 
     private static final ImageFilter imageFilter = new ImageFilter() {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffCcittTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffCcittTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffCcittTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffCcittTest.java Wed Oct 23 22:04:22 2013
@@ -175,7 +175,7 @@ public class TiffCcittTest extends TiffB
                 params.put(ImagingConstants.PARAM_KEY_COMPRESSION,
                         TiffConstants.TIFF_COMPRESSION_CCITT_1D);
                 final byte[] compressed = Imaging.writeImageToBytes(image,
-                        ImageFormat.IMAGE_FORMAT_TIFF, params);
+                        ImageFormat.TIFF, params);
                 final BufferedImage result = Imaging.getBufferedImage(compressed);
                 compareImages(image, result);
             } catch (final ImageWriteException ex) {
@@ -195,7 +195,7 @@ public class TiffCcittTest extends TiffB
                         TiffConstants.TIFF_COMPRESSION_CCITT_GROUP_3);
                 params.put(TiffConstants.PARAM_KEY_T4_OPTIONS, 0);
                 final byte[] compressed = Imaging.writeImageToBytes(image,
-                        ImageFormat.IMAGE_FORMAT_TIFF, params);
+                        ImageFormat.TIFF, params);
                 final BufferedImage result = Imaging.getBufferedImage(compressed);
                 compareImages(image, result);
             } catch (final ImageWriteException ex) {
@@ -215,7 +215,7 @@ public class TiffCcittTest extends TiffB
                         TiffConstants.TIFF_COMPRESSION_CCITT_GROUP_3);
                 params.put(TiffConstants.PARAM_KEY_T4_OPTIONS, 4);
                 final byte[] compressed = Imaging.writeImageToBytes(image,
-                        ImageFormat.IMAGE_FORMAT_TIFF, params);
+                        ImageFormat.TIFF, params);
                 final BufferedImage result = Imaging.getBufferedImage(compressed);
                 compareImages(image, result);
             } catch (final ImageWriteException ex) {
@@ -235,7 +235,7 @@ public class TiffCcittTest extends TiffB
                         TiffConstants.TIFF_COMPRESSION_CCITT_GROUP_3);
                 params.put(TiffConstants.PARAM_KEY_T4_OPTIONS, 1);
                 final byte[] compressed = Imaging.writeImageToBytes(image,
-                        ImageFormat.IMAGE_FORMAT_TIFF, params);
+                        ImageFormat.TIFF, params);
                 final BufferedImage result = Imaging.getBufferedImage(compressed);
                 compareImages(image, result);
             } catch (final ImageWriteException ex) {
@@ -255,7 +255,7 @@ public class TiffCcittTest extends TiffB
                         TiffConstants.TIFF_COMPRESSION_CCITT_GROUP_3);
                 params.put(TiffConstants.PARAM_KEY_T4_OPTIONS, 5);
                 final byte[] compressed = Imaging.writeImageToBytes(image,
-                        ImageFormat.IMAGE_FORMAT_TIFF, params);
+                        ImageFormat.TIFF, params);
                 final BufferedImage result = Imaging.getBufferedImage(compressed);
                 compareImages(image, result);
             } catch (final ImageWriteException ex) {
@@ -274,7 +274,7 @@ public class TiffCcittTest extends TiffB
                 params.put(ImagingConstants.PARAM_KEY_COMPRESSION,
                         TiffConstants.TIFF_COMPRESSION_CCITT_GROUP_4);
                 final byte[] compressed = Imaging.writeImageToBytes(image,
-                        ImageFormat.IMAGE_FORMAT_TIFF, params);
+                        ImageFormat.TIFF, params);
                 final BufferedImage result = Imaging.getBufferedImage(compressed);
                 compareImages(image, result);
             } catch (final ImageWriteException ex) {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java Wed Oct 23 22:04:22 2013
@@ -52,7 +52,7 @@ public class TiffRoundtripTest extends T
 
             final File tempFile = createTempFile(imageFile.getName() + ".", ".tif");
             final Map<String,Object> params = new HashMap<String,Object>();
-            Imaging.writeImage(image, tempFile, ImageFormat.IMAGE_FORMAT_TIFF,
+            Imaging.writeImage(image, tempFile, ImageFormat.TIFF,
                     params);
             image = null;
 

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/xmp/XmpUpdateTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/xmp/XmpUpdateTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/xmp/XmpUpdateTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/xmp/XmpUpdateTest.java Wed Oct 23 22:04:22 2013
@@ -51,7 +51,7 @@ public class XmpUpdateTest extends Imagi
 
             String xmpXml = Imaging.getXmpXml(imageFile);
             if (null == xmpXml
-                    && imageFormat.equals(ImageFormat.IMAGE_FORMAT_GIF)) {
+                    && imageFormat.equals(ImageFormat.GIF)) {
                 xmpXml = "temporary test until I can locate a GIF with XMP in the wild.";
             }
             if (null == xmpXml) {
@@ -60,15 +60,15 @@ public class XmpUpdateTest extends Imagi
 
             assertNotNull(xmpXml);
 
-            if (imageFormat.equals(ImageFormat.IMAGE_FORMAT_PNG)) { /*
+            if (imageFormat.equals(ImageFormat.PNG)) { /*
                                                                      * do
                                                                      * nothing
                                                                      */
-            } else if (imageFormat.equals(ImageFormat.IMAGE_FORMAT_TIFF)) { /*
+            } else if (imageFormat.equals(ImageFormat.TIFF)) { /*
                                                                              * do
                                                                              * nothing
                                                                              */
-            } else if (imageFormat.equals(ImageFormat.IMAGE_FORMAT_GIF)) { /*
+            } else if (imageFormat.equals(ImageFormat.GIF)) { /*
                                                                             * do
                                                                             * nothing
                                                                             */

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/RoundtripTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/RoundtripTest.java?rev=1535193&r1=1535192&r2=1535193&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/RoundtripTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/RoundtripTest.java Wed Oct 23 22:04:22 2013
@@ -64,41 +64,41 @@ public class RoundtripTest extends Imagi
     }
 
     private static final FormatInfo FORMAT_INFOS[] = { //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_PNG, true, true,
+            new FormatInfo(ImageFormat.PNG, true, true,
                     COLOR_FULL_RGB, true, true), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_GIF, true, true,
+            new FormatInfo(ImageFormat.GIF, true, true,
                     COLOR_LIMITED_INDEX, true, false), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_ICO, true, true,
+            new FormatInfo(ImageFormat.ICO, true, true,
                     COLOR_FULL_RGB, true, true), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_TIFF, true, true,
+            new FormatInfo(ImageFormat.TIFF, true, true,
                     COLOR_FULL_RGB, true, true), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_JPEG, true, false,
+            new FormatInfo(ImageFormat.JPEG, true, false,
                     COLOR_FULL_RGB, true, true), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_BMP, true, true,
+            new FormatInfo(ImageFormat.BMP, true, true,
                     COLOR_FULL_RGB, true, true), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_PSD, true, false,
+            new FormatInfo(ImageFormat.PSD, true, false,
                     COLOR_FULL_RGB, true, true), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_PBM, true, true,
+            new FormatInfo(ImageFormat.PBM, true, true,
                     COLOR_BITMAP, true, false), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_PGM, true, true,
+            new FormatInfo(ImageFormat.PGM, true, true,
                     COLOR_GRAYSCALE, true, false), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_PPM, true, true,
+            new FormatInfo(ImageFormat.PPM, true, true,
                     COLOR_FULL_RGB, true, false), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_PAM, true, true,
+            new FormatInfo(ImageFormat.PAM, true, true,
                     COLOR_FULL_RGB, true, false),//
             // new FormatInfo(ImageFormat.IMAGE_FORMAT_PNM, true, true,
             // COLOR_FULL_RGB, true), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_TGA, false, false,
+            new FormatInfo(ImageFormat.TGA, false, false,
                     COLOR_FULL_RGB, true, true), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_WBMP, true, true,
+            new FormatInfo(ImageFormat.WBMP, true, true,
                     COLOR_BITMAP, true, false), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_PCX, true, true,
+            new FormatInfo(ImageFormat.PCX, true, true,
                     COLOR_FULL_RGB, true, true), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_DCX, true, true,
+            new FormatInfo(ImageFormat.DCX, true, true,
                     COLOR_FULL_RGB, true, true), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_XBM, true, true,
+            new FormatInfo(ImageFormat.XBM, true, true,
                     COLOR_BITMAP, false, false), //
-            new FormatInfo(ImageFormat.IMAGE_FORMAT_XPM, true, true,
+            new FormatInfo(ImageFormat.XPM, true, true,
                     COLOR_FULL_RGB, false, false), //
     };
 



Mime
View raw message