summaryrefslogtreecommitdiff
path: root/additions/SW/fancy-qr-codes/overlay-qr.pl
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2016-11-10 19:14:40 +0000
committerdakkar <dakkar@thenautilus.net>2016-11-10 19:14:51 +0000
commit207844ee0d269545c9c885f34f6cf2395449358b (patch)
treec6f305927cdc85722e6aa71dda27e9fa50e8cde9 /additions/SW/fancy-qr-codes/overlay-qr.pl
parentallow parsed_literal blocks (diff)
downloadthenautilus-207844ee0d269545c9c885f34f6cf2395449358b.tar.gz
thenautilus-207844ee0d269545c9c885f34f6cf2395449358b.tar.bz2
thenautilus-207844ee0d269545c9c885f34f6cf2395449358b.zip
fancy QR codes articla
Diffstat (limited to 'additions/SW/fancy-qr-codes/overlay-qr.pl')
-rw-r--r--additions/SW/fancy-qr-codes/overlay-qr.pl25
1 files changed, 25 insertions, 0 deletions
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);