Skip to content

Commit 6d70f9c

Browse files
authored
add support for endroid/qr-code (with logo) version 6 (#143)
1 parent 92487ac commit 6d70f9c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/Providers/Qr/EndroidQrCodeWithLogoProvider.php

+9-5
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ public function getQRCodeImage(string $qrText, int $size): string
3333

3434
$logo = null;
3535
if ($this->logoPath) {
36-
$logo = Logo::create($this->logoPath);
37-
if ($this->logoSize) {
38-
$logo->setResizeToWidth($this->logoSize[0]);
39-
if (isset($this->logoSize[1])) {
40-
$logo->setResizeToHeight($this->logoSize[1]);
36+
if ($this->endroid6) {
37+
$logo = new Logo($this->logoPath, ...$this->logoSize);
38+
} else {
39+
$logo = Logo::create($this->logoPath);
40+
if ($this->logoSize) {
41+
$logo->setResizeToWidth($this->logoSize[0]);
42+
if (isset($this->logoSize[1])) {
43+
$logo->setResizeToHeight($this->logoSize[1]);
44+
}
4145
}
4246
}
4347
}

0 commit comments

Comments
 (0)