qrcode
qrcode copied to clipboard
Usage examples
Hi ! This looks like a very useful package but it is not at all clear how to use it to actually create QR codes as part of another haskell project.
would be great to have some code snippets and "hello world" examples.
The most basic usage is the following:
import Codec.Picture
import Codec.QRCode
import Codec.QRCode.JuicyPixels
main :: IO ()
main = do
case encode (defaultQRCodeOptions M) Iso8859_1OrUtf8WithoutECI "Hello World: 1234 // ¢Aぴ¥" of
Just qrcode -> savePngImage "/tmp/test.png" (ImageY8 $ toImage 0 1 qrcode)
Nothing -> fail "error encoding the qrcode"
I hope that helps as a starting point.