-
-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added an example with png rounded modules using gd #215
Conversation
Oh wow, this is incredible! Just let me have a quick look over the commit. 🚀 |
Also, i noticed that your branch is like 6 months behind |
Update: it's because the |
Thank you for your review, i will fix this issues. But i can't see |
Yes, |
All done! However, I am not sure about PHPCS complaining about single if conditions like |
Also, I have checked that everything is working fine |
I agree that this case is a bit weird, but there's no way to my knowledge to exclude these cases via the xml config. I have added them throughout the library for consistency, alternatively you can just disable the ckech for that line with a
That's great! Thank you for your contribution! 🚀 |
examples/pngWithRoundedShapes.php
Outdated
$x2 = (($x + 1) * $this->scale); | ||
$y2 = (($y + 1) * $this->scale); | ||
|
||
$rectsize = $this->scale / 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes an "implicit conversion from float to int" exception in imagefilledrectangle()
-> cast to int or use intdiv()
// -------------------- | ||
|
||
class QRCustomPNG extends QRGdImage { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also intercept the constructor to enable the internal upscaling for "rounder" corners at lower scales (which would be counter-intuitive for the user to set):
public function __construct(SettingsContainerInterface $options, QRMatrix $matrix){
$options->drawCircularModules = true;
parent::__construct($options, $matrix);
}
Result:
Similar to:
#127