diff options
Diffstat (limited to 'lib/private/legacy/OC_Image.php')
-rw-r--r-- | lib/private/legacy/OC_Image.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/private/legacy/OC_Image.php b/lib/private/legacy/OC_Image.php index e6a815a3cf7..1b1d98325ba 100644 --- a/lib/private/legacy/OC_Image.php +++ b/lib/private/legacy/OC_Image.php @@ -124,7 +124,11 @@ class OC_Image implements \OCP\IImage { * @return int */ public function width() { - return $this->valid() ? imagesx($this->resource) : -1; + if ($this->valid() && (($width = imagesx($this->resource)) !== false)) { + return $width; + } else { + return -1; + } } /** @@ -133,7 +137,11 @@ class OC_Image implements \OCP\IImage { * @return int */ public function height() { - return $this->valid() ? imagesy($this->resource) : -1; + if ($this->valid() && (($height = imagesy($this->resource)) !== false)) { + return $height; + } else { + return -1; + } } /** |