WhyNotHugo / python-barcode

㊙️ Create standard barcodes with Python. No external dependencies. 100% Organic Python.
http://python-barcode.rtfd.io/
MIT License
572 stars 123 forks source link

fix wrong bar width in ImageWriter #186

Closed fostermaier closed 1 year ago

fostermaier commented 1 year ago

fixes #79 and maybe others?

This might seem trivial, but took me a couple of minutes to track it down. I'm attaching false-colored images for reference. Please pay attention to the final white bar in particular. SvgWriter is not affected as the rectangle implementation is different.

DPI 300

before before

after after

DPI 100

before

after

fostermaier commented 1 year ago

might also be related to #39

codecov[bot] commented 1 year ago

Codecov Report

Base: 80.58% // Head: 80.63% // Increases project coverage by +0.04% :tada:

Coverage data is based on head (6073331) compared to base (0489239). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #186 +/- ## ========================================== + Coverage 80.58% 80.63% +0.04% ========================================== Files 17 17 Lines 886 888 +2 ========================================== + Hits 714 716 +2 Misses 172 172 ``` | [Impacted Files](https://codecov.io/gh/WhyNotHugo/python-barcode/pull/186?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Hugo+Osvaldo+Barrera) | Coverage Δ | | |---|---|---| | [barcode/writer.py](https://codecov.io/gh/WhyNotHugo/python-barcode/pull/186/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Hugo+Osvaldo+Barrera#diff-YmFyY29kZS93cml0ZXIucHk=) | `95.08% <100.00%> (+0.04%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Hugo+Osvaldo+Barrera). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Hugo+Osvaldo+Barrera)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

fostermaier commented 1 year ago

Sorry about the noise. I just saw that I accidentally pushed to the PR branch. Feel free to cherry-pick.

The changes induced by the second commit, if merged, fix #30 as we are using it for borderless barcodes in our project.

WhyNotHugo commented 1 year ago

The changes in the resulting images look good to me. I haven't yet had a change to sit down and understand the code changes, I'll get back to you once I have.

WhyNotHugo commented 1 year ago

Thanks!