1
0
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:
Mikael Roos
2020-01-15 16:51:39 +01:00
parent 8fec09b195
commit c563275ed5
8 changed files with 39 additions and 20 deletions

View File

@@ -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}");
}