commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1393659 - in /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm: PgmFileInfo.java PpmFileInfo.java
Date Wed, 03 Oct 2012 18:40:39 GMT
Author: damjan
Date: Wed Oct  3 18:40:38 2012
New Revision: 1393659

URL: http://svn.apache.org/viewvc?rev=1393659&view=rev
Log:
Fix typos in PGM/PPM.


Modified:
    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/PpmFileInfo.java

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=1393659&r1=1393658&r2=1393659&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  3 18:40:38 2012
@@ -53,27 +53,27 @@ public class PgmFileInfo extends FileInf
 
     @Override
     public int getBitDepth() {
-        return 8;
+        return max;
     }
 
     @Override
     public ImageFormat getImageType() {
-        return ImageFormat.IMAGE_FORMAT_PPM;
+        return ImageFormat.IMAGE_FORMAT_PGM;
     }
 
     @Override
     public String getImageTypeDescription() {
-        return "PGM: portable pixmap file    format";
+        return "PGM: portable graymap file format";
     }
 
     @Override
     public String getMIMEType() {
-        return "image/x-portable-pixmap";
+        return "image/x-portable-graymap";
     }
 
     @Override
     public int getColorType() {
-        return ImageInfo.COLOR_TYPE_RGB;
+        return ImageInfo.COLOR_TYPE_GRAYSCALE;
     }
 
     @Override

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=1393659&r1=1393658&r2=1393659&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  3 18:40:38 2012
@@ -31,7 +31,7 @@ public class PpmFileInfo extends FileInf
     public PpmFileInfo(int width, int height, boolean RAWBITS, int max) throws ImageReadException
{
         super(width, height, RAWBITS);
         if (max <= 0) {
-            throw new ImageReadException("PGM maxVal " + max
+            throw new ImageReadException("PPM maxVal " + max
                     + " is out of range [1;65535]");
         } else if (max <= 255) {
             scale = 255f;
@@ -40,7 +40,7 @@ public class PpmFileInfo extends FileInf
             scale = 65535f;
             bytesPerSample = 2;
         } else {
-            throw new ImageReadException("PGM maxVal " + max
+            throw new ImageReadException("PPM maxVal " + max
                     + " is out of range [1;65535]");
         }
         this.max = max;
@@ -53,27 +53,27 @@ public class PpmFileInfo extends FileInf
 
     @Override
     public int getBitDepth() {
-        return 8;
+        return max;
     }
 
     @Override
     public ImageFormat getImageType() {
-        return ImageFormat.IMAGE_FORMAT_PGM;
+        return ImageFormat.IMAGE_FORMAT_PPM;
     }
 
     @Override
     public String getImageTypeDescription() {
-        return "PGM: portable graymap file    format";
+        return "PPM: portable pixmap file format";
     }
 
     @Override
     public String getMIMEType() {
-        return "image/x-portable-graymap";
+        return "image/x-portable-pixmap";
     }
 
     @Override
     public int getColorType() {
-        return ImageInfo.COLOR_TYPE_GRAYSCALE;
+        return ImageInfo.COLOR_TYPE_RGB;
     }
 
     @Override



Mime
View raw message