mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-01 05:50:12 +02:00
Support PHP 7.4, some minor fixes with notices.
This commit is contained in:
@@ -1023,13 +1023,15 @@ class CImage
|
||||
$this->log("Init dimension (before) newWidth x newHeight is {$this->newWidth} x {$this->newHeight}.");
|
||||
|
||||
// width as %
|
||||
if ($this->newWidth[strlen($this->newWidth)-1] == '%') {
|
||||
if ($this->newWidth
|
||||
&& $this->newWidth[strlen($this->newWidth)-1] == '%') {
|
||||
$this->newWidth = $this->width * substr($this->newWidth, 0, -1) / 100;
|
||||
$this->log("Setting new width based on % to {$this->newWidth}");
|
||||
}
|
||||
|
||||
// height as %
|
||||
if ($this->newHeight[strlen($this->newHeight)-1] == '%') {
|
||||
if ($this->newHeight
|
||||
&& $this->newHeight[strlen($this->newHeight)-1] == '%') {
|
||||
$this->newHeight = $this->height * substr($this->newHeight, 0, -1) / 100;
|
||||
$this->log("Setting new height based on % to {$this->newHeight}");
|
||||
}
|
||||
|
Reference in New Issue
Block a user