diff --git a/system/Images/Handlers/GDHandler.php b/system/Images/Handlers/GDHandler.php index 12ea4e1a72e2..01c05384c744 100644 --- a/system/Images/Handlers/GDHandler.php +++ b/system/Images/Handlers/GDHandler.php @@ -56,9 +56,6 @@ protected function _rotate(int $angle): bool // Rotate it! $destImg = imagerotate($srcImg, $angle, $white); - // Kill the file handles - imagedestroy($srcImg); - $this->resource = $destImg; return true; @@ -87,9 +84,6 @@ protected function _flatten(int $red = 255, int $green = 255, int $blue = 255) imagefilledrectangle($dest, 0, 0, $this->width, $this->height, $matte); imagecopy($dest, $srcImg, 0, 0, 0, 0, $this->width, $this->height); - // Kill the file handles - imagedestroy($srcImg); - $this->resource = $dest; return $this; @@ -192,7 +186,6 @@ protected function process(string $action) $copy($dest, $src, 0, 0, (int) $this->xAxis, (int) $this->yAxis, $this->width, $this->height, $origWidth, $origHeight); - imagedestroy($src); $this->resource = $dest; return $this; @@ -281,7 +274,7 @@ public function save(?string $target = null, int $quality = 90): bool throw ImageException::forInvalidImageCreate(); } - imagedestroy($this->resource); + $this->resource = null; chmod($target, $this->filePermissions);