Merge pull request #61176 from nextcloud/fix/deprecated-85

fix: resolve PHP deprecation of `imagedestroy`
This commit is contained in:
Kate 2026-06-11 08:14:34 +02:00 committed by GitHub
commit 0302d60f0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 9 deletions

View file

@ -265,12 +265,7 @@ class ImageManager {
}
}
$tmpFile = $newTmpFile;
imagedestroy($outputImage);
} catch (\Exception $e) {
if (isset($outputImage) && is_resource($outputImage) || $outputImage instanceof \GdImage) {
imagedestroy($outputImage);
}
$this->logger->debug($e->getMessage());
}
}

View file

@ -508,7 +508,6 @@ class Image implements IImage {
if ($res) {
if (imagealphablending($res, true)) {
if (imagesavealpha($res, true)) {
imagedestroy($this->resource);
$this->resource = $res;
return true;
} else {
@ -926,7 +925,6 @@ class Image implements IImage {
$res = imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig);
if ($res === false) {
$this->logger->debug(__METHOD__ . '(): Error re-sampling process image', ['app' => 'core']);
imagedestroy($process);
return false;
}
return $process;
@ -988,7 +986,6 @@ class Image implements IImage {
$this->logger->debug('Image->centerCrop, Error re-sampling process image ' . $width . 'x' . $height, ['app' => 'core']);
return false;
}
imagedestroy($this->resource);
$this->resource = $process;
return true;
}
@ -1009,7 +1006,6 @@ class Image implements IImage {
return false;
}
$result = $this->cropNew($x, $y, $w, $h);
imagedestroy($this->resource);
$this->resource = $result;
return $this->valid();
}