[BUGFIX] Invalid file used to compute image ratio in text with picture
[Packages/TYPO3.CMS.git] / typo3 / sysext / css_styled_content / Classes / Controller / CssStyledContentController.php
index 527c7d4..d44b99d 100644 (file)
@@ -590,7 +590,12 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
 
                                /** @var $file \TYPO3\CMS\Core\Resource\File */
                                if (MathUtility::canBeInterpretedAsInteger($imgs[$imgKey])) {
-                                       $file = $this->getResourceFactory()->getFileObject((int)$imgs[$imgKey]);
+                                       if ($imgListContainsReferenceUids) {
+                                               $file = $this->getResourceFactory()->getFileReferenceObject((int)$imgs[$imgKey])->getOriginalFile();
+                                       } else {
+                                               $file = $this->getResourceFactory()->getFileObject((int)$imgs[$imgKey]);
+                                       }
+
                                } else {
                                        $file = $this->getResourceFactory()->getFileObjectFromCombinedIdentifier($imgPath . $imgs[$imgKey]);
                                }