How to use QRImageWithLogo.php #220
Replies: 2 comments 18 replies
-
Hi! It löoks like you're using a v4.x example with the dev-main or beta branch (the class It seems the output instance is not invoked properly - it should look like this, where you replace php-qrcode/examples/custom_output.php Lines 31 to 36 in f012a15 |
Beta Was this translation helpful? Give feedback.
-
Okay, thanks. Using your first way (new QROptions with the MyCustomOutput) I get a qr code. As a path I used: ABSPATH."path-to-image.png"; And yes: I use PHP 8.1 And one last question: Thank you so much :-) |
Beta Was this translation helpful? Give feedback.
-
I am having issues with using the QRImageWithLogo.php ( https://github.com/chillerlan/php-qrcode/blob/f012a15bff005c028ee1428b5831344d89879180/examples/QRImageWithLogo.php )
The basic QR Code generation is working.
$data = 'https://URLTOPAGE'; echo '<img src="'.(new QRCode)->render($data).'" width="200" alt="QR Code" />';
But when I try to use the WithLogo version (from the example above):
`use chillerlan\QRCode\QRCode;
use chillerlan\QRCode\Output{QRCodeOutputException, QRImage};
require_once '/vendor/autoload.php';
class QRImageWithLogo extends QRImage{
public function dump(string $file = null, string $logo = null):string{
...
}
echo '';`
Fatal error: Uncaught Error: chillerlan\QRCode\Output\QRGdImage::__construct(): Argument #1 ($options) must be of type chillerlan\Settings\SettingsContainerInterface
And I have no idea, how I give QRImageWithLogo() what it needs.
I tried to find information about it here: https://php-qrcode.readthedocs.io/en/main/
But I am stuck.
Thanks for your help
Beta Was this translation helpful? Give feedback.
All reactions