Skip to content
Snippets Groups Projects
Unverified Commit 61887345 authored by Roeland Jago Douma's avatar Roeland Jago Douma Committed by GitHub
Browse files

Merge pull request #16964 from phpbg/master

Fix sanity checks #16963
parents d22ab5e7 94eb77a5
No related branches found
No related tags found
No related merge requests found
......@@ -878,10 +878,8 @@ class OC_Image implements \OCP\IImage {
$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;
}
......@@ -892,8 +890,8 @@ class OC_Image implements \OCP\IImage {
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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment