zxing-cpp icon indicating copy to clipboard operation
zxing-cpp copied to clipboard

search-multi: "This luminance source does not support cropping."

Open logidelic opened this issue 8 years ago • 4 comments

I've been using zxing-cpp for a while now and it seems to work just fine when trying to read a single code that is pre-cropped (in my case, a data-matrix). However, if I have an image that potentially contains multiple codes, I cannot figure out how to get zxing to decode these. If I execute:

./zxing --search-multi --try-harder --more -v myimage.png

I get the output:

Hybrid binarizer failed: zxing::IllegalArgumentException: This luminance source does not support cropping.
Global binarizer failed: zxing::IllegalArgumentException: This luminance source does not support cropping.

What exactly does this mean and is there any way of working around it?

Interestingly, if I process the exact same image (which contains one data-matrix and one bar-code) without the search-multi argument, it works (./zxing myimage.png)! (I assume that in this case it extracts the first code that it finds and ignores the rest?).

Any help would be appreciated.

logidelic avatar Dec 28 '16 19:12 logidelic

Hello, came across the same problem. Any update ?

lubo avatar Feb 27 '17 00:02 lubo

The following was merged last November:

https://github.com/glassechidna/zxing-cpp/pull/30

I'm not sure what needs to be done beyond that. This project is in maintenance mode only, however, pull requests are welcome.

Benjamin-Dobell avatar Feb 27 '17 02:02 Benjamin-Dobell

Thank you for reply. I cannot find GreyscaleLuminanceSource being used anywhere. The CLI utility uses LuminanceSource, not GreyscaleLuminanceSource.

lubo avatar Mar 01 '17 23:03 lubo

To me the multisearch appears completely broken. Here's a test case:

$ echo foo | qrencode -v 1 -o qr_foo.png
$ echo bar | qrencode -v 1 -o qr_bar.png
$ zxing qr_foo.png
foo

$ zxing qr_bar.png
bar

$ montage qr_foo.png qr_bar.png combined.png
$ zxing combined.png
decoding failed

$ zxing -v --search-multi combined.png
Hybrid binarizer failed: zxing::ReaderException: No code detected
Global binarizer failed: zxing::ReaderException: No code detected

$ zxing -v --search-multi --try-harder combined.png
Hybrid binarizer failed: zxing::ReaderException: No code detected
Global binarizer failed: zxing::ReaderException: No code detected

$ zxing -v --try-harder combined.png
Hybrid binarizer failed: zxing::ReaderException: No code detected
Global binarizer failed: zxing::ReaderException: No code detected

zbarimg manages to find and decode both codes

$ zbarimg combined.png
QR-Code:bar

QR-Code:foo

scanned 2 barcode symbols from 1 images in 0.01 seconds

jose1711 avatar Jan 02 '20 08:01 jose1711