Two-dimensional codes sometimes have borders and sometimes don't.
stlswm opened this issue · comments
When the size is 200 px, there is no border, but when set to 210 px, there is another 10 px border.
This is due to the simple scaling algorithm I've implemented. try to use an image prosessing lib for the scaling to prevent this issue.
Hi @boombuler 👋
It seems this issue is still occurring, take a look at the following example:
- https://qr-api.ashleyprimo.com/?size=400&data=This%20is%20example%20data (encoding string "This is example data", scaling to 400x400) -> QR size before scaling 25
- https://qr-api.ashleyprimo.com/?size=400&data=This%20is%20a%20lot%20of%20example%20data%20to%20encode. (encoding string "This is a lot of example data to encode.", again scaled to 400x400) -> QR size before scaling 29
Happy to provide any additional data to support
Hi @ashleyprimo
I didn't change anything.
If you need a solution, it might help to check out some libs like github.com/nfnt/resize to resize the barcode.
Since the barcodes implement the image interface it should work out of the box
Thanks for that information, and my apologies - misread your previous message there! I will give this a go and see how I get on!