Skip to content

Commit 8049976

Browse files
committed
:octocat: add QROptionsTrait::$gdImageUseUpscale
1 parent 57448af commit 8049976

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/Output/QRGdImage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function dump(string $file = null){
228228
*/
229229
protected function createImage(){
230230

231-
if($this->drawCircularModules && $this->options->scale < 20){
231+
if($this->drawCircularModules && $this->options->gdImageUseUpscale && $this->options->scale < 20){
232232
// increase the initial image size by 10
233233
$this->length *= 10;
234234
$this->scale *= 10;

src/QROptionsTrait.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,18 @@ trait QROptionsTrait{
339339
*/
340340
protected int $quality = -1;
341341

342+
/*
343+
* QRGdImage settings
344+
*/
345+
346+
/**
347+
* Toggles the usage of internal upscaling when `QROptions::$drawCircularModules` is set to `true` and
348+
* `QROptions::$scale` is less than 20
349+
*
350+
* @see \chillerlan\QRCode\Output\QRGdImage::createImage()
351+
* @see https://github.com/chillerlan/php-qrcode/issues/23
352+
*/
353+
protected bool $gdImageUseUpscale = true;
342354

343355
/*
344356
* QRImagick settings

0 commit comments

Comments
 (0)