-
Notifications
You must be signed in to change notification settings - Fork 86
Add QR code parsing and rendering #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Container docker avec - flask-socketio - php et escpos-tools
Installation instructions
…ties like timeouts.
…pos-tools into moveToSocketServer
Nothing tested here!
Partially deal with other FS subcommands
…ps://github.com/gilbertfl/escpos-netprinter into 1-deal-with-pre-print-requests-from-pos-systems
…directory to dockerignore.
Correct bugs discovered by testing.
…rom-pos-systems' into 1-deal-with-pre-print-requests-from-pos-systems
…-netprinter into QRcode-backport
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be removed from the project, since composer generates it at install time.
|
|
||
| error_log("esc2html starting", 0); | ||
| // Usage | ||
| if (!isset($argv[1])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argument parsing is modified to add a --debug option.
This is to help debug any file parsing problems.
| private $y1 = null; | ||
| private $y2 = null; | ||
|
|
||
| private $data = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since $data and $datasize are protected members of the superclass, they must not be redeclared here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The placeholder for all 2D codes except for QR codes.
| margin: 1em; | ||
| /*margin: 1em;*/ | ||
| padding: 1em; | ||
| min-width: 28em; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed since I needed the width to be exactly 80mm.
|
|
||
| //To implement GS ( k <Function 182>, Transmit the size information of the symbol data in the symbol storage area | ||
| public function printQRCodeStateInfo(){ | ||
| //TODO: implement the status info - this is probably unnecessary for the ESCPOS-netprinter project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably not useful at all for escpos-tools, since there is no bidirectional communication going on.
| $qroptions->versionMax = 40; | ||
| break; | ||
| case 51: | ||
| # TODO: decide what to do if someone wants a MicroQR code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MicroQR codes are not supported in chillerlan/php-qrcode
This PR backports the QR code parsing and rendering routines developed for the gilbertfl/escpos-netprinter project.
It resolves the feature request in #59. Since it is compatible with PHP 8.4, this PR should supersede the PHP8 conversion from the PR related to #76 and resolve the problem in #82.
To do the rendering of the QR codes, a new dependency is introduced: the chillerlan/php-qrcode library, which itself depends on composer, mbstring and imagick.
This PR has been cut down to only the files that are necessary, since the escpos-netprinter project is more of a derivative than a fork. This note is important since I DO NOT propose to remove any files in escpos-tools (like the licence or CONTRIBUTING files).
The only binary blob in this PR is the "NoQR.jpg" file: this is a QR code that encodes the string "No QR code here!". This QR code is substituted when a badly-behaving input demands printing a code before it's data has been stored. It is used esc2html.php at line 140.