2 namespace TYPO3\CMS\Install\ViewHelpers\File;
44 public function render($dimension =
'width')
46 return static::renderStatic(
48 'dimension' => $dimension,
51 $this->renderingContext
64 $dimension = $arguments[
'dimension'];
65 if ($dimension !==
'width' && $dimension !==
'height') {
66 throw new \TYPO3\CMS\Install\ViewHelpers\Exception(
67 'Dimension must be either \'width\' or \'height\'',
72 if (!is_file($absolutePathToFile)) {
73 throw new \TYPO3\CMS\Install\ViewHelpers\Exception(
78 $actualDimension = getimagesize($absolutePathToFile);
79 if ($dimension ===
'width') {
80 $size = $actualDimension[0];
82 $size = $actualDimension[1];