qr-code icon indicating copy to clipboard operation
qr-code copied to clipboard

Corner radius for barcode data

Open UVLabs opened this issue 4 years ago • 3 comments

Is it possible to create barcodes with corner radius like this?

Screenshot 2021-06-24 at 11 30 59 AM

You can see this in action here: https://larsjung.de/jquery-qrcode/latest/demo/ https://larsjung.de/jquery-qrcode/

Other customization ideas can be seen here:

https://larsjung.de/jquery-qrcode/ https://larsjung.de/kjua/

UVLabs avatar Jun 24 '21 15:06 UVLabs

Hi @UVLabs thank you for your suggestion. looks like a nice addition. I don't have the time to do this myself but I will mark this as an opportunity for contribution.

endroid avatar Jun 27 '21 06:06 endroid

Hey @endroid, I would like to do this, also I would like to add possibility to change corner shape, to add an overlay if possible. What's the best place to start checking the code for such features to implement?

syntaxgirl avatar Feb 07 '22 21:02 syntaxgirl

Hi @syntaxgirl you could create your own writer, like the ones created here https://github.com/endroid/qr-code/tree/master/src/Writer. As you can see in the PngWriter you can start by retrieving the matrix and then use that to build your drawing logic on. For the PNG writer this is a simple loop but for determining if you want round corners you probably want to check adjacent cells. Good luck!

endroid avatar Feb 09 '22 10:02 endroid

I'm closing this ticket because of lack of input. However if anyone still wants to add this feature, feel free to reopen / make a PR.

endroid avatar Oct 04 '22 14:10 endroid

challenge accepted.

bartoszswiety avatar Mar 30 '23 18:03 bartoszswiety