From 207844ee0d269545c9c885f34f6cf2395449358b Mon Sep 17 00:00:00 2001 From: dakkar Date: Thu, 10 Nov 2016 19:14:40 +0000 Subject: fancy QR codes articla --- additions/SW/fancy-qr-codes/overlay-qr.pl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 additions/SW/fancy-qr-codes/overlay-qr.pl (limited to 'additions/SW/fancy-qr-codes/overlay-qr.pl') diff --git a/additions/SW/fancy-qr-codes/overlay-qr.pl b/additions/SW/fancy-qr-codes/overlay-qr.pl new file mode 100644 index 0000000..b2cf1c2 --- /dev/null +++ b/additions/SW/fancy-qr-codes/overlay-qr.pl @@ -0,0 +1,25 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Data::QRCode; +use Imager::QRCode::Fancy; +use Imager; + +my ($string,$input_file,$output_file) = @ARGV; + +my $qr_code = Data::QRCode->new( + input_data => $string, + error_correction_level => 'H', +); + +print "width: ",$qr_code->width,"\n"; + +my $src_img = Imager->new( + file => $input_file, +) or die Imager->errstr; + +my $img = Imager::QRCode::Fancy::make({ + qr_code => $qr_code, + image => $src_img, +}); +$img->write(file=>$output_file); -- cgit v1.2.3