Skip to content
Snippets Groups Projects
Commit b8f7bae5 authored by Frans Saris's avatar Frans Saris Committed by Sascha Egerer
Browse files

[BUGFIX] Prevent division by 0 when using image file without dimensions

Resolves: #79902
Releases: master
Change-Id: I42a126369108434e33d3b00d4fe6b556592dc2c9
Reviewed-on: https://review.typo3.org/51750


Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarSascha Egerer <sascha@sascha-egerer.de>
Tested-by: default avatarSascha Egerer <sascha@sascha-egerer.de>
parent 2cac5a36
Branches
Tags
No related merge requests found
......@@ -128,11 +128,18 @@ class Area
*/
public function makeRelativeBasedOnFile(FileInterface $file)
{
$width = $file->getProperty('width');
$height = $file->getProperty('height');
if (empty($width) || empty($height)) {
return self::createEmpty();
}
return new self(
$this->x / $file->getProperty('width'),
$this->y / $file->getProperty('height'),
$this->width / $file->getProperty('width'),
$this->height / $file->getProperty('height')
$this->x / $width,
$this->y / $height,
$this->width / $width,
$this->height / $height
);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment