1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-14 10:45:54 +02:00
This commit is contained in:
Ryan Cramer
2023-10-19 10:07:13 -04:00
parent 1f4d32ded9
commit ee6f88dec2

View File

@@ -176,7 +176,15 @@ class FieldtypeImage extends FieldtypeFile implements FieldtypeHasFiles, Fieldty
if($info) {
unset($info['ratio']); // ratio not stored in runtime image info
$pagefile->setImageInfo($info);
$w = isset($info['width']) ? (int) $info['width'] : 0;
$h = isset($info['height']) ? (int) $info['height'] : 0;
if($w === -100 && $h === -100) {
// we were previously unable to determine width and height
// so do not populate the cached values, forcing it to re-check
// this only occurs on SVG files
} else {
$pagefile->setImageInfo($info);
}
}
return $pagefile;