mirror of
https://github.com/nextcloud/server.git
synced 2026-06-15 11:41:20 -04:00
Fix typing problems in OC_Image
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
11b51ddbbe
commit
3fe20bfbbb
2 changed files with 11 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ interface IImage {
|
|||
public function save($filePath = null, $mimeType = null);
|
||||
|
||||
/**
|
||||
* @return resource|\GdImage Returns the image resource in any.
|
||||
* @return false|resource|\GdImage Returns the image resource if any
|
||||
* @since 8.1.0
|
||||
*/
|
||||
public function resource();
|
||||
|
|
|
|||
Loading…
Reference in a new issue