1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
[ // CTYP v6 (March 10)
define_type('QR', -description = 'QR code generation');
/*-----------------------------------------------------------------------------------------
DESCRIPTION
QR type, QR Code
Based upon qrencode from Kentaro Fukuchi, fukuchi@megaui.net
http://fukuchi.org/works/qrencode/
http://fukuchi.org/works/qrencode/manual/index.html
Installation notes for Mac OS X Snow Leopard
=============================================
Lasso 8.6 tested only
cd ~
mkdir qr
cd qr/
tar zxvf qrencode-3.1.1.tar.gz
cd qrencode-3.1.1
export png_CFLAGS="-I /usr/X11/include/"
export png_LIBS="-lpng -L/usr/X11/lib/"
touch pkg-config
chmod +x pkg-config
export PATH=$PATH:.
./configure --enable-static --disable-shared // Not documented anywhere else, contacted Kentaro
(old version was ./configure only)
make
n.b.: The make script did not take into consideration Mac OS X. Therefore the binary will reside inside the directory where the make file is.
Copy this binary file "qrencode" after a make is done without errors, into /usr/local/bin/ and it will work. If not, check your $PATH environment
variable and make sure /usr/local/bin/ is indeed listed there. More information on environment variables on the Internets.
Permissions for Lasso file writing will have to be met. More details on Thtevie's page: http://www.stevepiercy.com/lasso_stuff/file_perms.lasso
rf_shell is my mod of the shell tag, which encapsulates os_process for it to work (this can get really time consuming as it's tricky). Find it here:
http://tagswap.net/shell
XTools will need to be installed in order to compile the qrencoder files
Now to make a QR code:
./qrencode -o ~/Desktop/modulo.png "http://www.modulo.ro"
-o output filename
-s number size (number), specify the size of dot (pixel) (default = 3)
-l {LMQH} level of error correction, from L lowest to H highest
-v number symversion (number), the version of the symbol (default = auto)
-m number margin width (default = 4)
-S structured, make structured symbols. Version must be specified
-c case sensitive. encode lower-case alphabet characters in 8-bit mode (default)
-i ignore case, only use upper case
-8 use 8 bit. -k, -c, -i will be ignored
-v display the version number and copyrights of the qrencode
Examples
--------
qrencode -o ~/Desktop/google.png "http://www.google.com"
qrencode -o ~/Desktop/google5.png -s 5 "http://www.google.com"
qrencode -o ~/Desktop/google10.png -s 10 "http://www.google.com"
qrencode -o ~/Desktop/domain.png -s 10 -l H -m 20 -c "http://www.domain.com?p=contact&employee=fred%20rocking&department=accounting"
PROPERTIES
size - pixel size (default 3)
error_collection - error collection level, from Lowest, to Medium, to Q to Highest, default L // not really implemented
version - version of the symbol, default = auto // not implemented
margin - margin of the code, default = 4
structured - boolean, make structured symbols, version must be specified // not implemented
kanji - boolean, assume kanji (shift-jis)
casesensitive - boolean, encode lower case alphabet characters in 8-bit (default)
ignorecase - boolean, ignore case distinctions and only use uppercase characters
8bit - use 8 bit only (k, c, i will be ignored)
inputString - the string to be input
qr_home - home of the qrencode binary
METHODS
qr->generate(-required = 'path', -required = 'filename'); generates the outputted png file, path must include terminus "/", filename without suffix (will always be .png)
qr->version; shows what version
VERSION HISTORY
v1.0 2011.06.27 21:16:00 created
LICENSE
Public Domain
FEEDBACK
Rich Fortnum, fortnum@viaduct-productions.com
Viaduct Productions http://www.viaduct-productions.com
KUDOS
Pier Kuipers - insight into quotation usage re: ' vs "
James Harvard - BASH Shell escaping of quotations
Kentaro Kukuchi - Original qrencode (libqrencode) binaries & implementation
Latest version available from <http://tagSwap.net/QR>.
TBD:
-----------------------------------------------------------------------------------------*/
// ========================================================================================================================================================== PROPERTIES
local('size') = 3; // I have re-iterated default values here
local('error_collection') = 'L';
local('version') = 'auto';
local('margin') = 4;
local('structured') = true;
local('kanji') = false;
local('casesensitive') = false;
local('ignorecase') = false;
local('8bit') = false;
local('qr_home') = 'qrencode';
// ========================================================================================================================================================== CONSTRUCTOR
define_tag('onCreate', -description = 'ctyp instance onCreate method');
// ==> insert incoming parameters into the properties
local('paramName') = string;
iterate(params, local('i'));
if(#i->type == 'pair');
#paramname = #i->first;
#paramName->removeleading('-');
self->properties->first->keys >> #paramName ? self->#paramName = encode_sql(#i->second);
else;
#paramName = #i;
#paramName->removeleading('-');
self->properties->first->keys >> #paramName ? self->#paramName = true;
/if;
/iterate;
/define_tag;
// ========================================================================================================================================================== METHODS
define_tag('change', -required = 'property', -required = 'value', -description = 'generic set method');
self->#property = #value;
/define_tag;
define_tag('show_properties', -description = 'displays properties in a nicer matter');
local('f') = '<div class="trouble">PROPERTIES:<br>';
local('myProps') = self->properties->first;
iterate(#myProps, local('t'));
local('myPropName') = #t->first;
#f += '- ' + #t->first + ' (' + self->#myPropname->type + ') = ' + #t->second + '<br>';
/iterate;
#f += '</div>';
return(@#f);
/define_tag;
define_tag('show_methods', -description = 'shows methods & descriptions for this type');
local('f') = '<div class="trouble">PROPERTIES:<br>';
iterate(self->properties->second, local('t'));
#f += #t + '<br>';
/iterate;
#f += '</div>';
return(@#f);
/define_tag;
define_tag('generate', -description = 'generates the QR code with the supplied location', -required = 'path', -type = 'string', -required = 'filename', -type = 'string', -required = 'inputString', -copy, -type = 'string', -optional = 'feedback', -type = boolean); // path has terminal "/"
local('syntax') = self->'qr_home' + ' -o ' + #path + #filename + ' -s ' + self->'size' + ' -l ' + self->'error_collection' + ' -m ' + self->'margin';
!local_defined('feedback') ? local('feedback') = false;
self->'kanji' ? #syntax += ' -k';
self->'casesensitive' ? #syntax += ' -c';
self->'ignorecase' ? #syntax += ' -i';
self->'8bit' ? #syntax += ' -8';
#syntax += ' ';
#inputString = string_replaceregexp(#inputString, -find='\'', -replace='\'\\\'\'');
#syntax += '\'' + #inputString + '\'';
inline(-username = $un, -password = $pw);
local('p1') = rf_shell(#syntax); // remember to match up this tagname to shell
/inline;
local('out') = 'QR string: ' + #syntax;
#feedback ? return(#syntax);
/define_tag;
define_tag('version', -description = 'shows version of qrencode');
local('syntax') = self->'qr_home' + ' -V';
inline(-username = $un, -password = $pw);
local('f') = rf_shell(#syntax); // remember to match up this tagname to shell
/inline;
return(#f);
/define_tag;
/define_type;
]
|