Disallow BufferedImage of type TYPE_CUSTOM -- not decoding properly, and is kind of a weird case from ImageIO anyway

git-svn-id: https://zxing.googlecode.com/svn/trunk@241 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2008-03-03 22:45:52 +00:00
parent f79bb97605
commit bdcf60913b
3 changed files with 4 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

View file

@ -1,2 +0,0 @@
ÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP
árvíztűrő tükörfúrógép

View file

@ -45,6 +45,9 @@ public final class BufferedImageMonochromeBitmapSource implements MonochromeBitm
private static final int LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
public BufferedImageMonochromeBitmapSource(BufferedImage image) {
if (image.getType() == BufferedImage.TYPE_CUSTOM) {
throw new IllegalArgumentException("Can't handle BufferedImage of type TYPE_CUSTOM");
}
this.image = image;
blackPoint = 0x7F;
lastMethod = null;
@ -125,9 +128,7 @@ public final class BufferedImageMonochromeBitmapSource implements MonochromeBitm
}
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
return true;
}
/**