mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
make the reader aware that imagecrop() returns a new image and therefore 2 image resources need to be freed after using it.
-- Provided by anonymous 82013 () git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@344273 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
9421e06e34
commit
c2b0f6ace4
1 changed files with 2 additions and 0 deletions
|
@ -61,6 +61,8 @@ $im2 = imagecrop($im, ['x' => 0, 'y' => 0, 'width' => $size, 'height' => $size])
|
|||
if ($im2 !== FALSE) {
|
||||
imagepng($im2, 'example-cropped.png');
|
||||
}
|
||||
imagedestroy($im);
|
||||
imagedestroy($im2);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
Loading…
Reference in a new issue