You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if you pass invalid values to the resize function it does not throw an error and ends up
creating bad images
Warnings
Warning: imagecreatetruecolor(): Invalid image dimensions in
vendor\claviska\simpleimage\src\claviska\SimpleImage.php on line 805
Warning: imagecolorallocatealpha() expects parameter 1 to be resource, bool given in vendor\claviska\simpleimage\src\claviska\SimpleImage.php on line 806
Warning: imagecolortransparent() expects parameter 1 to be resource, bool given in vendor\claviska\simpleimage\src\claviska\SimpleImage.php on line 807
Warning: imagefill() expects parameter 1 to be resource, bool given in
vendor\claviska\simpleimage\src\claviska\SimpleImage.php on line 808
Warning: imagecopyresampled() expects parameter 1 to be resource, bool given in vendor\claviska\simpleimage\src\claviska\SimpleImage.php on line 816
[Broken] Code
(You should use the change as a percentage so you dot get zero or negative heights :P )
The text was updated successfully, but these errors were encountered:
Madpeterz
changed the title
Images from file can fail in fun and weird ways but not trigger try catch
resize function does not check size values
Mar 2, 2022
Thanks for reporting this. I'm not sure there's anything to do here, as runtime type checking isn't something I want to add to every method. I agree that it would be more graceful to catch these instead of seeing warnings.
Versions:
PHP 7.4.27 (cli)
claviska/simpleimage ^3.6
if you pass invalid values to the resize function it does not throw an error and ends up
creating bad images
Warnings
[Broken] Code
(You should use the change as a percentage so you dot get zero or negative heights :P )
The text was updated successfully, but these errors were encountered: