diff --git a/lib/private/legacy/OC_Image.php b/lib/private/legacy/OC_Image.php index b9ef31ed9fac2..4486a78463483 100644 --- a/lib/private/legacy/OC_Image.php +++ b/lib/private/legacy/OC_Image.php @@ -989,7 +989,7 @@ public function centerCrop($size = 0) { $targetWidth = $width; $targetHeight = $height; } - $process = imagecreatetruecolor($targetWidth, $targetHeight); + if ($width > 0 and $height > 0){ $process = imagecreatetruecolor($width, $height); } else { $process = false; } if ($process == false) { $this->logger->error('OC_Image->centerCrop, Error creating true color image', ['app' => 'core']); imagedestroy($process);