mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Fix typo in method "isRotate*d*Supported"; don't attempt to rotate images of unknown format
git-svn-id: https://zxing.googlecode.com/svn/trunk@238 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
7c475c5cad
commit
905b1f7676
|
@ -118,7 +118,7 @@ final class YUVMonochromeBitmapSource implements MonochromeBitmapSource {
|
|||
throw new IllegalStateException("Rotate not supported");
|
||||
}
|
||||
|
||||
public boolean isRotatedSupported() {
|
||||
public boolean isRotateSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -93,6 +93,6 @@ public interface MonochromeBitmapSource {
|
|||
* @return true iff rotation is supported
|
||||
* @see #rotateCounterClockwise()
|
||||
*/
|
||||
boolean isRotatedSupported();
|
||||
boolean isRotateSupported();
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -112,7 +112,7 @@ public final class LCDUIImageMonochromeBitmapSource implements MonochromeBitmapS
|
|||
throw new IllegalStateException("Rotate not supported");
|
||||
}
|
||||
|
||||
public boolean isRotatedSupported() {
|
||||
public boolean isRotateSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue