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

Test fixtures generate differently on newer versions of ghostscript #124

Closed
adamchainz opened this issue Aug 4, 2018 · 8 comments
Closed

Comments

@adamchainz
Copy link
Owner

Currently on Travis ghostscript 9.10 is used, and it's compatible with the files in tests/fixtures/. However on my Mac I now get version 9.23 and that leads to the tests failing. It seems that one extra pixel is (wrongly?) drawn on newer versions. Perhaps there's some argument we can pass to newer ghostscript versions to preserve the apparently correct older rendering.

@adamchainz
Copy link
Owner Author

9.10 azteccode

azteccode-old

9.23 azteccode

azteccode

🤔

@jcassee
Copy link
Contributor

jcassee commented Aug 5, 2018

Interestingly, I have been given feedback about my treepoem-generated Aztec codes not being correct (with Ghostscript 9.22). I have been experimenting with the inkspread parameter to try and compensate (assumptions...), but unfortunately the feedback loop is very slow.

Anyway, as requested in #113, these are the test fixture barcodes that my system (Ubuntu 18.04, Ghostscript 9.22) generates:

azteccode.png:
azteccode

code39.png:
code39

code128.png:
code128

interleaved2of5.png:
interleaved2of5

pdf417.png:
pdf417

qrcode.png:
qrcode

@adamchainz
Copy link
Owner Author

Yeah those all look like they have been smeared like I'm seeing. Did you try downgrading your ghostscript and seeing if that fulfills your user's requirements?

Running here with {'inkspread': '0.1'} gets me PNG's that look right, but they're smaller, e.g. I get 76x76 for aztec instead of 78x78 from the old ghostscript:

azteccode

@jcassee
Copy link
Contributor

jcassee commented Aug 21, 2018

Using Ghostscript 9.18, the Aztec barcode looks better, and is scanned by my app. (The gs 9.22 version (above) is not recognized.)

azteccode

Update: I tried all versions between 9.18 and 9.22 and the change seems to be from 9.21 to 9.22. There are no notable changes for 9.22, though.

@adamchainz
Copy link
Owner Author

Thanks for bisecting it. I've reported upstream in bwipp/postscriptbarcode#94, the maintainer of BWIPP is pretty knowledgable and may be able to help.

@adamchainz
Copy link
Owner Author

N.B. Travis CI seem to have updated the version of ghostscript on their build containers so this is failing continuously now

@adamchainz
Copy link
Owner Author

It looks like the fix was released in Ghostscript 9.26. I think some more work is needed to pass different flags to render, potentially by not using PIL any more.

adamchainz added a commit that referenced this issue Jun 19, 2019
Now the fix is in for the smearing reported in #124. These three barcodes still
look a bit smeared (perhaps we need to pass some more options to Ghostscript
as I noted on the issue) but they are still readable by an online barcode
scanner I checked with.
adamchainz added a commit that referenced this issue Jun 19, 2019
Now the fix is in for the smearing reported in #124. These three barcodes still
look a bit smeared (perhaps we need to pass some more options to Ghostscript
as I noted on the issue) but they are still readable by an online barcode
scanner I checked with.
@adamchainz
Copy link
Owner Author

#499 improved image generation by bypassing the PIL EPS plugin that runs Ghostscript, so this can be considered fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants