endroid / qr-code

QR Code Generator
https://endroid.nl
MIT License
4.45k stars 726 forks source link

White space below logo when applying text label #389

Closed johnrix closed 2 years ago

johnrix commented 2 years ago

When using both a logo and label, I am observing additional white space being added below the logo image.

With text label: image

Without text label: image

Am presently using version 4.6.

Code used to generate the above is as follows:

    $url = 'clr.ie/125372';
        $schemePlusUrl = 'https://' . $url;

        $builder = Builder::create()
            ->writer(new PngWriter())
            ->writerOptions([])
            ->data($schemePlusUrl)
            // ->labelText($url)
            ->encoding(new Encoding('ISO-8859-1'));

        if ($includelogo) {
            $logo = 'templates/blackandwhite/images/Logo/ClearCircle/Blue.png';
            $builder->logoPath($logo)->logoResizeToWidth(120)->logoPunchoutBackground(true)->errorCorrectionLevel(new ErrorCorrectionLevelHigh());
        }

        $result = $builder->build();
endroid commented 2 years ago

Hi @johnrix thank you. There appeared to be an error in the punchout calculation. This should be fixed in 4.6.1.

johnrix commented 2 years ago

Thanks for the quick turnaround!