diff --git a/lib/private/legacy/OC_Image.php b/lib/private/legacy/OC_Image.php index 259d8bc29ffbc..45e8bd88bef02 100644 --- a/lib/private/legacy/OC_Image.php +++ b/lib/private/legacy/OC_Image.php @@ -124,11 +124,13 @@ public function mimeType() { * @return int */ public function width() { - if ($this->valid() && (($width = imagesx($this->resource)) !== false)) { - return $width; - } else { - return -1; + if ($this->valid()) { + $width = imagesx($this->resource); + if ($width !== false) { + return $width; + } } + return -1; } /** @@ -137,11 +139,13 @@ public function width() { * @return int */ public function height() { - if ($this->valid() && (($height = imagesy($this->resource)) !== false)) { - return $height; - } else { - return -1; + if ($this->valid()) { + $height = imagesy($this->resource); + if ($height !== false) { + return $height; + } } + return -1; } /**