mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
More fixes, to cropping BufferedImages
git-svn-id: https://zxing.googlecode.com/svn/trunk@1109 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
431ace93e1
commit
b710e257eb
|
@ -121,21 +121,23 @@ public final class GenericMultipleBarcodeReader implements MultipleBarcodeReader
|
||||||
|
|
||||||
// Decode left of barcode
|
// Decode left of barcode
|
||||||
if (minX > MIN_DIMENSION_TO_RECUR) {
|
if (minX > MIN_DIMENSION_TO_RECUR) {
|
||||||
doDecodeMultiple(image.crop(0, 0, (int) minX, height), hints, results, 0, 0);
|
doDecodeMultiple(image.crop(0, 0, (int) minX, height),
|
||||||
|
hints, results, xOffset, yOffset);
|
||||||
}
|
}
|
||||||
// Decode above barcode
|
// Decode above barcode
|
||||||
if (minY > MIN_DIMENSION_TO_RECUR) {
|
if (minY > MIN_DIMENSION_TO_RECUR) {
|
||||||
doDecodeMultiple(image.crop(0, 0, width, (int) minY), hints, results, 0, 0);
|
doDecodeMultiple(image.crop(0, 0, width, (int) minY),
|
||||||
|
hints, results, xOffset, yOffset);
|
||||||
}
|
}
|
||||||
// Decode right of barcode
|
// Decode right of barcode
|
||||||
if (maxX < width - MIN_DIMENSION_TO_RECUR) {
|
if (maxX < width - MIN_DIMENSION_TO_RECUR) {
|
||||||
doDecodeMultiple(image.crop((int) maxX, 0, width - (int) maxX, height),
|
doDecodeMultiple(image.crop((int) maxX, 0, width - (int) maxX, height),
|
||||||
hints, results, (int) maxX, 0);
|
hints, results, xOffset + (int) maxX, yOffset);
|
||||||
}
|
}
|
||||||
// Decode below barcode
|
// Decode below barcode
|
||||||
if (maxY < height - MIN_DIMENSION_TO_RECUR) {
|
if (maxY < height - MIN_DIMENSION_TO_RECUR) {
|
||||||
doDecodeMultiple(image.crop(0, (int) maxY, width, height - (int) maxY),
|
doDecodeMultiple(image.crop(0, (int) maxY, width, height - (int) maxY),
|
||||||
hints, results, 0, (int) maxY);
|
hints, results, xOffset, yOffset + (int) maxY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ public final class BufferedImageLuminanceSource extends LuminanceSource {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LuminanceSource crop(int left, int top, int width, int height) {
|
public LuminanceSource crop(int left, int top, int width, int height) {
|
||||||
return new BufferedImageLuminanceSource(image, left, top, width, height);
|
return new BufferedImageLuminanceSource(image, this.left + left, this.top + top, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can't run AffineTransforms on images of unknown format.
|
// Can't run AffineTransforms on images of unknown format.
|
||||||
|
|
Loading…
Reference in a new issue