If the logo is enabled and there are less than 17 characters, the qr image will not be displayed. #96
-
As i said in the title, if the logo option is enabled (with QRImageWithLogo) and you provide less than 17 characters to the qrcode, We are using version 3.4.1 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
That's probably because the QR Code is too small to properly fit the logo and ECC bytes. Please note that logos in QR Codes are not part of the specification and more of a gimmick. The problem is that the logo space simply overwrites the QR data and relies on the error correction and at a certain size there are not enough ECC bytes left to properly restore the content. |
Beta Was this translation helpful? Give feedback.
-
So if i understood correctly, What's weird is that it works with more than 17, not with less. |
Beta Was this translation helpful? Give feedback.
-
I assume you let the encoder decide on the Version by itself (aka, default settings). So if you then encode a data string that's only 3 characters, it will choose the smallest QR version. If you'd add a logo space to that, there are barely any QR pixels left to hold the data. So I'd recommend to increase the QR version (aka, size of the QR matrix) to circumvent this, like so (using the logo example): $data = 'ABC';
$options = new QROptions;
$options->version = 7; // increase until your qrcodes are readable
$qrOutputInterface = new QRImageWithLogo($options, (new QRCode($options))->getMatrix($data));
// ... |
Beta Was this translation helpful? Give feedback.
-
Allright then. Thank you for the clarification, i think it might be useful to add it in the readme of the qr code with logo, as i think someone else will for sure stop on this. |
Beta Was this translation helpful? Give feedback.
-
Well there's a notice in the source already but i think it can't hurt to add some more detailed info to the wiki once I'm done with the upcoming version (which by the way includes a QR Code reader to ease testing...). |
Beta Was this translation helpful? Give feedback.
I assume you let the encoder decide on the Version by itself (aka, default settings). So if you then encode a data string that's only 3 characters, it will choose the smallest QR version. If you'd add a logo space to that, there are barely any QR pixels left to hold the data. So I'd recommend to increase the QR version (aka, size of the QR matrix) to circumvent this, like so (using the logo example):