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

CommandLineEncoder appears to ignore the height and width parameters when barcode_format is DATA_MATRIX #836

Open
ablegreen opened this Issue Jul 11, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@ablegreen

ablegreen commented Jul 11, 2017

CommandLineEncoder appears to ignore the height and width parameters when barcode_format is DATA_MATRIX

The following command produces a 14px by 14px image instead of a 500px by 500px image:

java -cp javase/target/javase-3.3.0-jar-with-dependencies.jar com.google.zxing.client.j2se.CommandLineEncoder --barcode_format DATA_MATRIX --height 500 --width 500 abcdefg

Here's a Dockerfile to reproduce this issue:

FROM ubuntu:16.04
RUN apt-get update && apt-get install -y --no-install-recommends default-jdk git maven
RUN git clone --depth 1 --branch zxing-3.3.0 https://github.com/zxing/zxing.git
RUN cd zxing && mvn install -DskipTests
RUN cd zxing/javase && mvn -DskipTests package assembly:single
RUN cd zxing && java -cp javase/target/javase-3.3.0-jar-with-dependencies.jar com.google.zxing.client.j2se.CommandLineEncoder --barcode_format DATA_MATRIX --height 500 --width 500 abcdefg

Is this a bug or am I using CommandLineEncoder wrong?

@srowen

This comment has been minimized.

Show comment
Hide comment
@srowen

srowen Jul 11, 2017

Contributor

You're right, I don't believe it actually respects those values. The DataMatrix encoder was adopted from another project and works somewhat differently. If you're interested in looking at plumbing through those values and trying to make it scale up the image and add padding like the QR code writer does I can look at that with you. It's a legitimate issue, yes.

Contributor

srowen commented Jul 11, 2017

You're right, I don't believe it actually respects those values. The DataMatrix encoder was adopted from another project and works somewhat differently. If you're interested in looking at plumbing through those values and trying to make it scale up the image and add padding like the QR code writer does I can look at that with you. It's a legitimate issue, yes.

@srowen srowen added the enhancement label Aug 23, 2017

@axxel

This comment has been minimized.

Show comment
Hide comment
@axxel

axxel Nov 21, 2017

Just as a reference for whom it may concern: We recently introduced this missing feature to the new c++ port. See nu-book/zxing-cpp@be46af7

The interesting part is the new generic Inflate function that is now used inside the QRWriter, the AztecWriter and the DatamatrixWriter. It takes a BitMatrix and inflates it by scaling it up and adding padding as necessary.

axxel commented Nov 21, 2017

Just as a reference for whom it may concern: We recently introduced this missing feature to the new c++ port. See nu-book/zxing-cpp@be46af7

The interesting part is the new generic Inflate function that is now used inside the QRWriter, the AztecWriter and the DatamatrixWriter. It takes a BitMatrix and inflates it by scaling it up and adding padding as necessary.

srowen added a commit that referenced this issue Dec 28, 2017

Proposed fix for Issue #836 - height and width parameters ignored whe…
…n barcode_format is DATA_MATRIX (#933)

* Proposed fix for Issue #836 - height and width parameters ignored when barcode_format is DATA_MATRIX

* Adding requested changes for PR #933

* Wording change in Javadoc to make the description more sensible

antimony added a commit to antimony/zxing that referenced this issue Oct 1, 2018

Proposed fix for Issue zxing#836 - height and width parameters ignore…
…d when barcode_format is DATA_MATRIX (zxing#933)

* Proposed fix for Issue zxing#836 - height and width parameters ignored when barcode_format is DATA_MATRIX

* Adding requested changes for PR zxing#933

* Wording change in Javadoc to make the description more sensible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment