diff --git a/lib/private/legacy/OC_Image.php b/lib/private/legacy/OC_Image.php index bbed6e6f671dd..9e754f57b7661 100644 --- a/lib/private/legacy/OC_Image.php +++ b/lib/private/legacy/OC_Image.php @@ -125,11 +125,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; } /** @@ -138,11 +140,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; } /**