A wrapper around zbar-tools to be used by Gemstone/S database. You may install the Linux stuff via
sudo apt-get install zbar-toolswith these external programs you may create images containing QR codes and you may even read image files to get the content out of the QR code.
a) You have a string and want to create a png file, containing the QR code for that string
| aMSKLibQRTool childState |
aMSKLibQRTool := MSKLibQRTool newPNGFor: 'www.spiegel.de' path: '/var/www/html/test.png' .
childState := aMSKLibQRTool
moduleSize: 15 ;
checkForToolPath ;
removeOutputFile ;
createQRCode ;
waitForProcessState ;
checkForOutputFile ;
checkForReturnCodea.2) Or as an alternative, which does all the checkings automatically:
| aMSKLibQRTool childState |
aMSKLibQRTool := MSKLibQRTool newPNGFor: 'www.spiegel1.de' path: '/var/www/html/test.png' .
childState := aMSKLibQRTool
moduleSize: 15 ;
createQRCodeAndWaitForResultb) You have a QR code (as png file) and want to get the link out of it:
| aMSKLibQRTool qrInformation |
aMSKLibQRTool := MSKLibQRTool readQRCodeFromPath: '/var/www/html/test.png' .
qrInformation :=
aMSKLibQRTool
readQRCode ;
waitForProcessState ;
checkForReturnCode ;
qrContentb.2) Or an alternative (with all checkings)
| aMSKLibQRTool |
aMSKLibQRTool := MSKLibQRTool readQRCodeFromPath: '/var/www/html/test.png' .
qrInformation := aMSKLibQRTool readQRCodeAndWaitForResultIn case of any errors exceptions should be thrown ...
You can load MSKLibQREncode using Metacello
Metacello new
repository: 'github://feldti/MSKLibQREncode:main/repository';
baseline: 'MSKLibQREncodeLibrary';
load