Bacon / BaconQrCode

QR Code Generator for PHP
BSD 2-Clause "Simplified" License
1.82k stars 208 forks source link

feat: add GD image backend #171

Closed arxeiss closed 5 months ago

arxeiss commented 5 months ago

Copy of closed #114


My client's web hosting provider sucks, and they don't have support for Imagick, even though they are promising it will be added.

I'm generating QR codes for payment, which is added into email body. And email client's do not have nice support for SVG. So I need old-school GD support.

However, GD has limited sets of functions. I believe, that it is OK, when that Renderer will have also limited sets of features. So this is not supported:

And because GD does not support Paths like Imagick or SVG do, I need to generate a bit different paths, so they are not so complex.


Sorry for opening new PR, but I had to change branch. I really needed the GD Renderer and in many projects I'm using this in package.json. Not to break them by changing commit name, I had to create new branch. But then it is not possible to change source branch in PR.

"repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/arxeiss/BaconQrCode"
        }
    ],
    "require": {
        "php": "^8.2",
        "bacon/bacon-qr-code": "dev-add-gd-backend#650e10121f4d8707ecdc5984b042cae7731e388a",
codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 90.83333% with 11 lines in your changes are missing coverage. Please review.

:exclamation: No coverage uploaded for pull request base (main@86deb82). Click here to learn what that means.

Files Patch % Lines
src/Renderer/GDLibRenderer.php 90.83% 11 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #171 +/- ## ======================================= Coverage ? 64.93% Complexity ? 981 ======================================= Files ? 48 Lines ? 3094 Branches ? 0 ======================================= Hits ? 2009 Misses ? 1085 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

DASPRiD commented 5 months ago

LGTM, thanks for your work! :)