diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/ImageViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/ImageViewHelper.php index 9eee0655f66d9ade04da25093e638d6c378f2456..73c57200ceea1dd835baebd2efbdd7eaa8a4cf53 100644 --- a/typo3/sysext/fluid/Classes/ViewHelpers/ImageViewHelper.php +++ b/typo3/sysext/fluid/Classes/ViewHelpers/ImageViewHelper.php @@ -120,26 +120,11 @@ class ImageViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedV 'crop' => $crop, ); $processedImage = $this->imageService->applyProcessingInstructions($image, $processingInstructions); - $tagWidthAttribute = (int)$processedImage->getProperty('width'); - $tagHeightAttribute = (int)$processedImage->getProperty('height'); - $trimmedWidthAttribute = (int)trim($width, 'cm'); - $trimmedHeightAttribute = (int)trim($height, 'cm'); - - if ($trimmedWidthAttribute !== $tagWidthAttribute) { - $tagWidthAttribute = $trimmedWidthAttribute; - } - if ($trimmedHeightAttribute !== $tagHeightAttribute) { - $tagHeightAttribute = $trimmedHeightAttribute; - } $imageUri = $this->imageService->getImageUri($processedImage, $absolute); $this->tag->addAttribute('src', $imageUri); - if (!empty($tagWidthAttribute)) { - $this->tag->addAttribute('width', $tagWidthAttribute); - } - if (!empty($tagHeightAttribute)) { - $this->tag->addAttribute('height', $tagHeightAttribute); - } + $this->tag->addAttribute('width', $processedImage->getProperty('width')); + $this->tag->addAttribute('height', $processedImage->getProperty('height')); $alt = $image->getProperty('alternative'); $title = $image->getProperty('title'); diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/MediaViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/MediaViewHelper.php index 7bdca6c6bb264b9ebfbdee0e64e6e7248dc74b0c..f967a096db81394c317c3bf7b20eed0ca67b8368 100644 --- a/typo3/sysext/fluid/Classes/ViewHelpers/MediaViewHelper.php +++ b/typo3/sysext/fluid/Classes/ViewHelpers/MediaViewHelper.php @@ -116,26 +116,11 @@ class MediaViewHelper extends AbstractTagBasedViewHelper ); $imageService = $this->getImageService(); $processedImage = $imageService->applyProcessingInstructions($image, $processingInstructions); - $tagWidthAttribute = (int)$processedImage->getProperty('width'); - $tagHeightAttribute = (int)$processedImage->getProperty('height'); - $trimmedWidthAttribute = (int)trim($width, 'cm'); - $trimmedHeightAttribute = (int)trim($height, 'cm'); - - if ($trimmedWidthAttribute !== $tagWidthAttribute) { - $tagWidthAttribute = $trimmedWidthAttribute; - } - if ($trimmedHeightAttribute !== $tagHeightAttribute) { - $tagHeightAttribute = $trimmedHeightAttribute; - } $imageUri = $imageService->getImageUri($processedImage); $this->tag->addAttribute('src', $imageUri); - if (!empty($tagWidthAttribute)) { - $this->tag->addAttribute('width', $tagWidthAttribute); - } - if (!empty($tagHeightAttribute)) { - $this->tag->addAttribute('height', $tagHeightAttribute); - } + $this->tag->addAttribute('width', $processedImage->getProperty('width')); + $this->tag->addAttribute('height', $processedImage->getProperty('height')); $alt = $image->getProperty('alternative'); $title = $image->getProperty('title');