Skip to content

If the logo is enabled and there are less than 17 characters, the qr image will not be displayed. #96

Answered by codemasher
nicolasvac asked this question in Q&A
Discussion options

You must be logged in to vote

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));

// ...

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by nicolasvac
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #95 on November 22, 2021 18:08.