Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommandLineRunner --raw option is broken for PDF_417 barcodes #1682

Closed
dlenski opened this issue Sep 7, 2023 · 0 comments · Fixed by #1683
Closed

CommandLineRunner --raw option is broken for PDF_417 barcodes #1682

dlenski opened this issue Sep 7, 2023 · 0 comments · Fixed by #1683
Assignees
Labels
Milestone

Comments

@dlenski
Copy link
Contributor

dlenski commented Sep 7, 2023

PDF_417 barcodes (and maybe other types as well) will break the --raw option, apparently because their com.google.zxing.Result method getRawBytes() returns null.


Using v3.5.1 and the test/barcodes/PDF_417-easy.bmp from https://github.com/dlenski/python-zxing as an example:

$ java -cp 'core.jar:javase.jar:jcommander.jar' com.google.zxing.client.j2se.CommandLineRunner PDF_417-easy.bmp --raw
Exception in thread "main" java.lang.NullPointerException
	at com.google.zxing.client.j2se.DecodeWorker.decode(DecodeWorker.java:172)
	at com.google.zxing.client.j2se.DecodeWorker.call(DecodeWorker.java:76)
	at com.google.zxing.client.j2se.CommandLineRunner.main(CommandLineRunner.java:99)

The error is coming from here:

for (byte b : result.getRawBytes()) {
rawData.append(String.format("%02X", b & 0xff));
rawData.append(" ");
}

The --raw option was added in 83650ce

dlenski added a commit to dlenski/python-zxing that referenced this issue Sep 7, 2023
The combination of '--raw' with certain barcode types, including PDF_417, is
broken: CommandLineRunner will fail with NullPointerException.

See zxing/zxing#1682 for more details.
dlenski added a commit to dlenski/python-zxing that referenced this issue Sep 7, 2023
The combination of '--raw' with certain barcode types, including PDF_417, is
broken: CommandLineRunner will fail with NullPointerException.

See zxing/zxing#1682 for more details.
@srowen srowen added the bug label Sep 7, 2023
@srowen srowen added this to the 3.5.3 milestone Sep 7, 2023
dlenski added a commit to dlenski/python-zxing that referenced this issue Sep 21, 2023
The combination of '--raw' with certain barcode types, including PDF_417, is
broken: CommandLineRunner will fail with NullPointerException.

See zxing/zxing#1682 for more details.
dlenski added a commit to dlenski/python-zxing that referenced this issue Nov 2, 2023
(This probably should have been done as part of 0512c7a.)

The --raw option was added in 3.5.0, but broken for certain barcode types
(PDF_417 and maybe others) until 3.5.3: CommandLineRunner will fail with
NullPointerException.

See zxing/zxing#1682 and
zxing/zxing#1683 for more details.
dlenski added a commit to dlenski/python-zxing that referenced this issue Feb 20, 2024
Among other improvements, this release of ZXing fixes the brokenness of the
`--raw` option (added in 3.5.0, but broken for `PDF_417` and maybe other
barcode types). See my bug report and fix for that issue at
zxing/zxing#1682 and
zxing/zxing#1683.
dlenski added a commit to dlenski/python-zxing that referenced this issue Feb 20, 2024
Among other improvements, this release of ZXing fixes the brokenness of the
`--raw` option (added in 3.5.0, but broken for `PDF_417` and maybe other
barcode types). See my bug report and fix for that issue at
zxing/zxing#1682 and
zxing/zxing#1683.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants