Fix typo in method "isRotate*d*Supported"; don't attempt to rotate images of unknown...
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 3 Mar 2008 21:36:03 +0000 (21:36 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 3 Mar 2008 21:36:03 +0000 (21:36 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@238 59b500cc-1b3d-0410-9834-0bbf25fbcc57

android/src/com/google/zxing/client/android/YUVMonochromeBitmapSource.java
core/src/com/google/zxing/MonochromeBitmapSource.java
core/src/com/google/zxing/oned/AbstractOneDReader.java
javame/src/com/google/zxing/client/j2me/LCDUIImageMonochromeBitmapSource.java
javase/src/com/google/zxing/client/j2se/BufferedImageMonochromeBitmapSource.java

index 3df1855..90dc085 100755 (executable)
@@ -118,7 +118,7 @@ final class YUVMonochromeBitmapSource implements MonochromeBitmapSource {
     throw new IllegalStateException("Rotate not supported");
   }
 
-  public boolean isRotatedSupported() {
+  public boolean isRotateSupported() {
     return false;
   }
 
index 799a6e1..f921ebb 100644 (file)
@@ -93,6 +93,6 @@ public interface MonochromeBitmapSource {
    * @return true iff rotation is supported
    * @see #rotateCounterClockwise()
    */
-  boolean isRotatedSupported();
+  boolean isRotateSupported();
 
 }
index a543f31..a754db2 100644 (file)
@@ -43,7 +43,7 @@ public abstract class AbstractOneDReader implements OneDReader {
     try {
       return doDecode(image, hints, tryHarder);
     } catch (ReaderException re) {
-      if (tryHarder && image.isRotatedSupported()) {
+      if (tryHarder && image.isRotateSupported()) {
         MonochromeBitmapSource rotatedImage = image.rotateCounterClockwise();
         return doDecode(rotatedImage, hints, tryHarder);        
       } else {
index 3f1e374..fbbf0da 100644 (file)
@@ -112,7 +112,7 @@ public final class LCDUIImageMonochromeBitmapSource implements MonochromeBitmapS
     throw new IllegalStateException("Rotate not supported");
   }
 
-  public boolean isRotatedSupported() {
+  public boolean isRotateSupported() {
     return false;
   }
 
index 92174bb..86f17fd 100644 (file)
@@ -124,8 +124,10 @@ public final class BufferedImageMonochromeBitmapSource implements MonochromeBitm
     return new BufferedImageMonochromeBitmapSource(rotatedImage);
   }
 
-  public boolean isRotatedSupported() {
-    return true;
+  public boolean isRotateSupported() {
+    return image.getType() != BufferedImage.TYPE_CUSTOM;
+    // Not sure what to make of the situation where a BufferedImage is parsed, but its format is not known
+    // In any event an AffineTransformOp on it will fail, so say it's not supported
   }
 
   /**