Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions system/Images/Handlers/GDHandler.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
Expand DownExpand Up@@ -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;
Expand DownExpand Up@@ -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;
Expand DownExpand Up@@ -281,7 +274,7 @@ public function save(?string $target = null, int $quality = 90): bool
throw ImageException::forInvalidImageCreate();
}

imagedestroy($this->resource);
Comment thread
ddevsr marked this conversation as resolved.
$this->resource = null;

chmod($target, $this->filePermissions);

Expand Down
Loading