PxPlus User Forum

Twitter Twitter Twitter

Author Topic: QR Code  (Read 1387 times)

Alain Stucki

  • Member
  • **
  • Posts: 12
    • View Profile
QR Code
« on: October 27, 2021, 02:25:17 AM »
Hello
From this topic: https://forum1.pvxplus.com/index.php?topic=205.0 I have learned how to create QR-Codes. And it seems to work fine. However, I found out that there are different levels of error correction in QR codes. Higher levels create bigger QR codes, but they become safer to read, even if you for example place a little logo on top of the QR code.
Is there any plan to further develop the *tools/makeqrcode tool to add more options like error-correction-level, size of PNG file, etc.?

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: QR Code
« Reply #1 on: October 27, 2021, 10:27:07 AM »
The *tools/makeqrcode is really just a web wrapper we provided to the Linux command 'qrencode' which is available for pretty much any Linux system.  We provided this tool so that clients on systems that didn't have the ability to run qrencode could still generate QR codes. 

When you call this utility, it passes the text to a special URL on our web site that takes the text, passes it to qrencode, and returns the resultant image.

If you are on a Linux system, you likely have qrencode already installed on your system or can install it yourself using tools like yum or apt-get.  This will allow you to invoke the command  directly from your program and specify whatever options you need.

Documentation on the command can be found at https://linux.die.net/man/1/qrencode
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Alain Stucki

  • Member
  • **
  • Posts: 12
    • View Profile
Re: QR Code
« Reply #2 on: October 28, 2021, 02:01:01 PM »
Dear Mr King

Thanks for your explanation. I'm using Windows both on server and clients.

I have visited the website you have linked and see that qrencode does provide an option for 4 different error correction levels. So I think the qrencode running on your server would be capable of using the 4 different levels.

Is there a possibility you could add to *tools/makeqrcode the possibility that when I call this utility and include the option for the error correction, it will pass the option to the qrencode service running on your server so I get the according PNG back?

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: QR Code
« Reply #3 on: October 28, 2021, 02:26:26 PM »
Try adding &quality=H to the URL used in the *tools/makeqrcode program:

LET url$="https://www.pvxplus.com/qrcode.pvp?serno="+STR(TCB(33))+"&text="+CVS(text$,"ASCII:URL")+"&quality=H"
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Alain Stucki

  • Member
  • **
  • Posts: 12
    • View Profile
Re: QR Code
« Reply #4 on: October 30, 2021, 08:00:11 AM »
Dear Mr. King

Thanks a lot for your reply! As far as I understand it correctly, I would need to change this inside the makeqrcode program code, correct?

I can LOAD "MAKEQRCODE" but when I type LIST or IT I get a message that makeqrcode is password protected and I need to type it. Unfortunately I don't know the password ;-)

If you would like to keep it password protected, maybe you could provide 4 different versions of this program, one for each error correction level L, M, Q and H. For example makeqrcodel, makeqrcodem, makeqrcodeq, makeqrcodeh. Or a makeqrcode2 and add the option to be able to CALL it with the option of L,M,Q or H?

Best regards and thank you very much for your support!

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: QR Code
« Reply #5 on: November 01, 2021, 11:06:47 AM »
You can find an updated makeqrcode program here that accepts an optional third argument consisting of a 1 character string with the Quality indicator (LQMH) as follows:

Level L (Low) - ​7% of data bytes can be restored.
Level M (Medium) - 15% of data bytes can be restored.
Level Q (Quartile) - ​25% of data bytes can be restored.
Level H (High) - 30% of data bytes can be restored.

Calling sequence is thus:

  CALL "*tools/makeqrcode","Text to encode", "outputfile.png", "X"

Where "X" can be L, M, Q, or H.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Alain Stucki

  • Member
  • **
  • Posts: 12
    • View Profile
Re: QR Code
« Reply #6 on: November 03, 2021, 06:23:26 AM »
Dear Mr. King

That's fantastic, thank you very very much! 👍