Skip to content

Commit

Permalink
add support for endroid/qr-code (with logo) version 6 (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowMaker authored Oct 24, 2024
1 parent 92487ac commit 6d70f9c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/Providers/Qr/EndroidQrCodeWithLogoProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
}
}
Expand Down

0 comments on commit 6d70f9c

Please sign in to comment.