From 6d70f9ca8e25568f163a7b3b3ff77bd8ea743978 Mon Sep 17 00:00:00 2001 From: YellowMaker <138113597+YellowMaker@users.noreply.github.com> Date: Thu, 24 Oct 2024 17:14:25 +0200 Subject: [PATCH] add support for endroid/qr-code (with logo) version 6 (#143) --- lib/Providers/Qr/EndroidQrCodeWithLogoProvider.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/Providers/Qr/EndroidQrCodeWithLogoProvider.php b/lib/Providers/Qr/EndroidQrCodeWithLogoProvider.php index 0a0b2d2..896a59b 100755 --- a/lib/Providers/Qr/EndroidQrCodeWithLogoProvider.php +++ b/lib/Providers/Qr/EndroidQrCodeWithLogoProvider.php @@ -33,11 +33,15 @@ public function getQRCodeImage(string $qrText, int $size): string $logo = null; if ($this->logoPath) { - $logo = Logo::create($this->logoPath); - if ($this->logoSize) { - $logo->setResizeToWidth($this->logoSize[0]); - if (isset($this->logoSize[1])) { - $logo->setResizeToHeight($this->logoSize[1]); + if ($this->endroid6) { + $logo = new Logo($this->logoPath, ...$this->logoSize); + } else { + $logo = Logo::create($this->logoPath); + if ($this->logoSize) { + $logo->setResizeToWidth($this->logoSize[0]); + if (isset($this->logoSize[1])) { + $logo->setResizeToHeight($this->logoSize[1]); + } } } }