digitalmars.D.announce - Just another QR code library
- Andrea Fontana (33/33) Oct 16 Hey everyone,
- Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= (6/11) Oct 17 After watching the recent video of Veritasium, I was planning to
- Salih Dincer (8/23) Oct 17 I haven't tried it yet, but it's an excellent example of
- Salih Dincer (4/5) Oct 17 Now i noticed save(), this is one of the range functions; i think
- Andrea Fontana (4/11) Oct 17 I was undecided whether to call the method 'save' or 'write', but
- Salih Dincer (4/7) Oct 17 My suggestion would be export, convert or better saveAs()...
- Andrea Fontana (3/11) Oct 17 I'm considering saveAs for the next version, then!
- Christian =?UTF-8?B?S8O2c3RsaW4=?= (5/10) Oct 17 Wow .. the png code is beautiful!
- Andrea Fontana (4/15) Oct 17 Minimal!
- Andrea Fontana (10/14) Oct 18 I have released a small update with some improvements:
Hey everyone, I've been working on a small project lately and thought I'd share it with you all. It's a simple QR code generation library. It is based on Project Nayuki's library. The main idea behind it was to create something that doesn't rely on any external dependencies. I know how annoying it can be when you want to do something simple like generating a QR code, and you end up having to install a bunch of packages. So, this library is completely self-contained. Some key points about it: - No external dependencies, as mentioned. - You can tweak various generation parameters to get the QR code just how you want it. - It supports exporting to different formats: SVG, PNG, and PPM. If you need something straightforward, this might be useful. `dub add qr` ```d import qr; import std.stdio; void main() { // ASCII art FTW QrCode("Hello D!").writeln(); // Save as PNG. Look, Ma, no external deps! QrCode("Hello D!").save("simple-qr.png"); } ``` The code and docs are up on GitHub https://github.com/trikko/qr Feel free to check it out, use it if you find it helpful, and let me know if you run into any issues or have suggestions for improvements. Cheers! Andrea Fontana
Oct 16
On Wednesday, 16 October 2024 at 12:58:29 UTC, Andrea Fontana wrote:Hey everyone, I've been working on a small project lately and thought I'd share it with you all. It's a simple QR code generation library. It is based on Project Nayuki's library. [...]After watching the recent video of Veritasium, I was planning to write one. Yours seems great. It is al so a good example when you write things half in C and half in D with importC. https://www.youtube.com/watch?v=w5ebcowAJD8
Oct 17
On Wednesday, 16 October 2024 at 12:58:29 UTC, Andrea Fontana wrote:```d import qr; import std.stdio; void main() { // ASCII art FTW QrCode("Hello D!").writeln(); // Save as PNG. Look, Ma, no external deps! QrCode("Hello D!").save("simple-qr.png"); } ``` Feel free to check it out, use it if you find it helpful, and let me know if you run into any issues or have suggestions for improvements. Cheers!I haven't tried it yet, but it's an excellent example of high-quality work, especially with the use of D's standard library and importC. Please accept my congratulations on your contribution. I have a small question: Is it possible to increase or decrease the image file resolution? SDB 79
Oct 17
On Thursday, 17 October 2024 at 10:33:08 UTC, Salih Dincer wrote:I haven't tried it yet...Now i noticed save(), this is one of the range functions; i think it's forwardrange. Hence the name which might cause confusion. SDB 79
Oct 17
On Thursday, 17 October 2024 at 10:40:33 UTC, Salih Dincer wrote:On Thursday, 17 October 2024 at 10:33:08 UTC, Salih Dincer wrote:I was undecided whether to call the method 'save' or 'write', but 'write' usually has a different structure, and in this case, I'm actually saving a file.I haven't tried it yet...Now i noticed save(), this is one of the range functions; i think it's forwardrange. Hence the name which might cause confusion. SDB 79
Oct 17
On Thursday, 17 October 2024 at 14:39:42 UTC, Andrea Fontana wrote:I was undecided whether to call the method 'save' or 'write', but 'write' usually has a different structure, and in this case, I'm actually saving a file.My suggestion would be export, convert or better saveAs()... SDB 79
Oct 17
On Thursday, 17 October 2024 at 16:07:57 UTC, Salih Dincer wrote:On Thursday, 17 October 2024 at 14:39:42 UTC, Andrea Fontana wrote:I'm considering saveAs for the next version, then! AndreaI was undecided whether to call the method 'save' or 'write', but 'write' usually has a different structure, and in this case, I'm actually saving a file.My suggestion would be export, convert or better saveAs()... SDB 79
Oct 17
On Wednesday, 16 October 2024 at 12:58:29 UTC, Andrea Fontana wrote:Hey everyone, ... - It supports exporting to different formats: SVG, PNG, and PPM. ... Andrea FontanaWow .. the png code is beautiful! Kind regards, Christian
Oct 17
On Thursday, 17 October 2024 at 17:40:30 UTC, Christian Köstlin wrote:On Wednesday, 16 October 2024 at 12:58:29 UTC, Andrea Fontana wrote:Minimal! AndreaHey everyone, ... - It supports exporting to different formats: SVG, PNG, and PPM. ... Andrea FontanaWow .. the png code is beautiful! Kind regards, Christian
Oct 17
On Wednesday, 16 October 2024 at 12:58:29 UTC, Andrea Fontana wrote:Hey everyone, I've been working on a small project lately and thought I'd share it with you all. It's a simple QR code generation library. It is based on Project Nayuki's library.I have released a small update with some improvements: - Added SVGZ format (still with no external dependencies!) - PNG files now use an indexed color palette and maximum compression - Deprecated save() in favor of saveAs() Now, a QRCode sized 2500x2500px (!) takes ~3.5KB as a PNG or ~750 bytes as an SVGZ. Andrea Fontana
Oct 18