2 namespace TYPO3\CMS\Fluid\ViewHelpers;
77 parent::initializeArguments();
80 $this->
registerTagAttribute(
'ismap',
'string',
'Specifies an image as a server-side image-map. Rarely used. Look at usemap instead',
false);
81 $this->
registerTagAttribute(
'longdesc',
'string',
'Specifies the URL to a document that contains a long description of an image',
false);
82 $this->
registerTagAttribute(
'usemap',
'string',
'Specifies an image as a client-side image-map',
false);
104 public function render($src = null, $width = null, $height = null, $minWidth = null, $minHeight = null, $maxWidth = null, $maxHeight = null, $treatIdAsReference =
false, $image = null, $crop = null, $absolute =
false)
106 if (is_null($src) && is_null($image) || !is_null($src) && !is_null($image)) {
107 throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception(
'You must either specify a string src or a File object.', 1382284106);
109 $image = $this->imageService->getImage($src, $image, $treatIdAsReference);
110 if ($crop === null) {
113 $processingInstructions = array(
116 'minWidth' => $minWidth,
117 'minHeight' => $minHeight,
118 'maxWidth' => $maxWidth,
119 'maxHeight' => $maxHeight,
122 $processedImage = $this->imageService->applyProcessingInstructions($image, $processingInstructions);
123 $imageUri = $this->imageService->getImageUri($processedImage, $absolute);
125 $this->tag->addAttribute(
'src', $imageUri);
126 $this->tag->addAttribute(
'width', $processedImage->getProperty(
'width'));
127 $this->tag->addAttribute(
'height', $processedImage->getProperty(
'height'));
129 $alt = $image->getProperty(
'alternative');
130 $title = $image->getProperty(
'title');
133 if (empty($this->arguments[
'alt'])) {
134 $this->tag->addAttribute(
'alt', $alt);
136 if (empty($this->arguments[
'title']) && $title) {
137 $this->tag->addAttribute(
'title', $title);
140 return $this->tag->render();