diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2021-12-02 11:30:10 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2021-12-06 14:26:26 +0100 |
commit | ab3a1d5706a5cc0c7f00b5d5ab47d493ffe68790 (patch) | |
tree | 8d81b02883455bf42389122ae196e25a5e40fc80 /lib/private/legacy/OC_Image.php | |
parent | d53722636830eb8b5abd3215afa3f4ea07ce65d2 (diff) | |
download | nextcloud-server-ab3a1d5706a5cc0c7f00b5d5ab47d493ffe68790.tar.gz nextcloud-server-ab3a1d5706a5cc0c7f00b5d5ab47d493ffe68790.zip |
Fix typing problems in OC_Image
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
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; + } } /** |