chillerlan / php-qrcode

A PHP QR Code generator and reader with a user-friendly API.
https://smiley.codes/qrcode/
Apache License 2.0
2.01k stars 302 forks source link

Reset scaled and length after toggling upscaled in QRGdImage #275

Closed GaiusCoffey closed 4 months ago

GaiusCoffey commented 4 months ago

After subclassing to overlay a logo, I encountered massive images when using options->drawCircularModules This was caused by scaling in underlying QrGdImage that doesn't reset underlying values.

Proposed changes

Add in an a call to setMatrixDimensions() immediately after toggling upscaled back to false. This should be a low cost way to reset the length and scale values to allow subclasses to use the output of dump()

Types of changes

What types of changes does your code introduce?

Checklist:

codemasher commented 4 months ago

Hey that's a reasonable change! I haven't considered this possibility yet. Thanks for your contribution!