erwanvivien / fast_qr

Ultra fast QRCode generation
https://fast-qr.com/
MIT License
197 stars 29 forks source link

Feature: image margins #50

Closed covercash2 closed 7 months ago

covercash2 commented 7 months ago

Our users want the ability to add a margin to the embedded image in QR codes.

Added Build::image_gap and changed the argument of Builder::image_size to remove the gap argument so it can be supplied separately.

erwanvivien commented 7 months ago

Hey @covercash2 thanks for the PR!

There already was the margins, it's the second param in image_size, I don't understand the difference between our outputs, I mean agree that your changes are great, but could you explain please :)

I also see you have update the generated JS bindings I'd like to know your wasm-bindgen version (wasm-bindgen --version) so I can update the .wasm too

covercash2 commented 7 months ago

i didn't see a way to define the gap without defining an image_size which seems to require some complicated downstream algebra 😅 we could definitely go that route, but this seemed simpler, unless i missed something.

this was a fresh install of wasm-bindgen for me:

❯ : wasm-bindgen --version
wasm-bindgen 0.2.91

thanks for the review! 🙏

erwanvivien commented 7 months ago

Ahh, I understand the problem! I'll reveiw a bit more the code, I think we can remove the double computaions

erwanvivien commented 7 months ago

I simplified code in the library too here #51

covercash2 commented 7 months ago

i'll defer to #51 then! 😄