diff --git a/core/components/phpthumbof/elements/snippets/phpthumbof.snippet.php b/core/components/phpthumbof/elements/snippets/phpthumbof.snippet.php index a1002af..cf8702d 100644 --- a/core/components/phpthumbof/elements/snippets/phpthumbof.snippet.php +++ b/core/components/phpthumbof/elements/snippets/phpthumbof.snippet.php @@ -56,13 +56,15 @@ if ($result['width'] === '' && $result['file'] && $dims = getimagesize($result['file']) ) { $result['width'] = $dims[0]; $result['height'] = $dims[1]; + $result['ratio'] = round($dims[1] / $dims[0] * 100 ,1); } if (!empty($toPlaceholder)) { $modx->setPlaceholders(array( - $toPlaceholder => $result['src'], - "$toPlaceholder.width" => $result['width'], - "$toPlaceholder.height" => $result['height'] - )); + 'src' => $result['src'], + 'width' => $result['width'], + 'height' => $result['height'], + 'ratio' => $result['ratio'], + ),$toPlaceholder.'.'); $output = ''; } if ($result['outputDims']) {