Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Avoid assignment in if clause
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc authored and backportbot[bot] committed Dec 6, 2021
commit f889b251b1f4d7542cf628c5502548a6620f93d9
20 changes: 12 additions & 8 deletions lib/private/legacy/OC_Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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;
}

/**
Expand Down