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
8 changes: 3 additions & 5 deletions lib/private/legacy/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -878,10 +878,8 @@ public function preciseResize(int $width, int $height): bool {
$widthOrig = imagesx($this->resource);
$heightOrig = imagesy($this->resource);
$process = imagecreatetruecolor($width, $height);

if ($process == false) {
if ($process === false) {
$this->logger->error(__METHOD__ . '(): Error creating true color image', array('app' => 'core'));
imagedestroy($process);
return false;
}

Expand All @@ -892,8 +890,8 @@ public function preciseResize(int $width, int $height): bool {
imagesavealpha($process, true);
}

imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig);
if ($process == false) {
$res = imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig);
if ($res === false) {
$this->logger->error(__METHOD__ . '(): Error re-sampling process image', array('app' => 'core'));
imagedestroy($process);
return false;
Expand Down