mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
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:
parent
f79bb97605
commit
bdcf60913b
Binary file not shown.
Before Width: | Height: | Size: 58 KiB |
|
@ -1,2 +0,0 @@
|
||||||
ÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP
|
|
||||||
árvíztűrő tükörfúrógép
|
|
|
@ -45,6 +45,9 @@ public final class BufferedImageMonochromeBitmapSource implements MonochromeBitm
|
||||||
private static final int LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
|
private static final int LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
|
||||||
|
|
||||||
public BufferedImageMonochromeBitmapSource(BufferedImage image) {
|
public BufferedImageMonochromeBitmapSource(BufferedImage image) {
|
||||||
|
if (image.getType() == BufferedImage.TYPE_CUSTOM) {
|
||||||
|
throw new IllegalArgumentException("Can't handle BufferedImage of type TYPE_CUSTOM");
|
||||||
|
}
|
||||||
this.image = image;
|
this.image = image;
|
||||||
blackPoint = 0x7F;
|
blackPoint = 0x7F;
|
||||||
lastMethod = null;
|
lastMethod = null;
|
||||||
|
@ -125,9 +128,7 @@ public final class BufferedImageMonochromeBitmapSource implements MonochromeBitm
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRotateSupported() {
|
public boolean isRotateSupported() {
|
||||||
return image.getType() != BufferedImage.TYPE_CUSTOM;
|
return true;
|
||||||
// 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