We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Since PHP8 the GD functions work with the GdImage class and no longer with resources. The __destruct function:
GdImage
__destruct
SimpleImage/src/claviska/SimpleImage.php
Lines 116 to 124 in a447473
resource
$img = imagecreatetruecolor(10,10); var_dump($img); // instance of class GdImage var_dump(is_resource($img)); // false
Run code in sandbox
Therefore the conditions are never met and the image is never destroyed.
Since PHP 7 support has been dropped, the function could be rewritten as:
protected $image = null; // snip /** * Destroys the image resource. */ public function __destruct() { if ($this->image instanceof \GdImage) { imagedestroy($this->image); } }
The text was updated successfully, but these errors were encountered:
Good catch. This was left over from a much earlier version — perhaps PHP 5.6. Would you like to send a PR for this update?
Sorry, something went wrong.
replace resource with GdImage (#326)
b25690f
fixes #325
Successfully merging a pull request may close this issue.
Since PHP8 the GD functions work with the
GdImage
class and no longer with resources.The
__destruct
function:SimpleImage/src/claviska/SimpleImage.php
Lines 116 to 124 in a447473
however checks if the the current image is both a
GdImage
as well as aresource
. But as far as I can test, GdImages are not resources:Run code in sandbox
Therefore the conditions are never met and the image is never destroyed.
Since PHP 7 support has been dropped, the function could be rewritten as:
The text was updated successfully, but these errors were encountered: