Issue Bug Closed

#103538A non-numeric value encountered GraphicalFunctions::getImageScale

Rafał Jania 04/05/24, 09:52 updated 07/16/24, 14:58

Description

ErrorException Warning: A non-numeric value encountered
/public/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php in TYPO3\CMS\Core\Imaging\GraphicalFunctions::getImageScale at line 2385

Both $w and $h values could be passed with ‘c’ letter, then
$h = (int)$h;

doesn’t work and the code in line 2385 fails
$info[0] = (int)ceil($info[0] * ($h / $info[1]);

GraphicalFunctions::getImageScale function called with parameters

h 254c
info [
   2000, 
   663, 
   jpg, 
   <filepath>
]
options    {
   maxH: 254c, 
   maxW: 338c, 
   noScale: null
}
w 0

In template:

<f:image image="{references.0}" alt="{title}" maxWidth="338c" maxHeight="254c" title="{title}" />

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.