0.01
No commit activity in last 3 years
No release in over 3 years
This library uses ImageMagick and RQRCode to create QR codes with rounded corners
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 2.15
~> 0.10
 Project Readme

liquid_code

About

This code creates a non-standard QR code that I call liquid code. It is much nicer than standard QR code.

I use it for business cards and doing nicer QR codes for my magazine articles and Bitcoin donations.

Example code: alt text

Install

Install as gem:

gem install liquid_code

Usage

First we need to create a string to be embedded in QR code. Here are some examples:

mecard='MECARD:N:Surname,John;TEL:+421232222222;EMAIL:testaccount@gmail.com;;'
mecard='MECARD:N:Surname,John;TEL:+421232222222;TEL:+421910123123;EMAIL:testaccount@gmail.com;;'
mecard='MECARD:N:Surname,John;TEL:+421232222222;TEL:+421910123123;EMAIL:testaccount@gmail.com;NOTE:PGP AAEAAA70 FP A2A5AAA872938472938472938472834729847870;;'
mecard='bitcoin:16nz9k1hyPcdU1oSku23deGo7d5RRM1rPQ'

You can create LiquidCode representation from either a string:

qr = LiquidCode.new(mecard)

or from RQRCode::QRCode, if you need more control about how the code should look:

qr = RQRCode::QRCode.new( mecard, :size => LiquidCode.minimum_qr_size_from_string(mecard), :level => :h )

Now let's create a PNG image:

qrcode_data = qr.as_png('white', 'black', true, 10)

f = File.new("output.png",'w')
f.write(qrcode_data)
f.close

There's also a script to create business card QR codes from a CSV file (a PGP key fingerprint is included in NOTE when present). You also need to change the company name in the ruby file.

Copying

Author: Juraj Bednar, see COPYING for license (simplified BSD license)

Pull requests welcome, please contribute!

Bitcoin donations welcome at 16nz9k1hyPcdU1oSku23deGo7d5RRM1rPQ Please donate if you use this.