diff --git a/Classes/Controller/ImageRenderingController.php b/Classes/Controller/ImageRenderingController.php index bde47353..4205e725 100644 --- a/Classes/Controller/ImageRenderingController.php +++ b/Classes/Controller/ImageRenderingController.php @@ -16,6 +16,8 @@ use TYPO3\CMS\Core\Resource; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Service\ImageService; +use TYPO3\CMS\Extbase\Object\ObjectManager; /** * Render the image attributes and reconstruct magic images, if necessary (and possible) @@ -76,6 +78,8 @@ public function renderImageAttributes($content = '', $conf) if ($fileUid) { try { $file = Resource\ResourceFactory::getInstance()->getFileObject($fileUid); + $objectManager = GeneralUtility::makeInstance(ObjectManager::class); + $imageService = $objectManager->get(ImageService::class); if ($imageAttributes['src'] !== $file->getPublicUrl()) { // Source file is a processed image $imageConfiguration = [ @@ -84,13 +88,15 @@ public function renderImageAttributes($content = '', $conf) ]; $processedFile = $this->getMagicImageService()->createMagicImage($file, $imageConfiguration); $additionalAttributes = [ - 'src' => $processedFile->getPublicUrl(), + 'src' => $imageService->getImageUri($processedFile), 'title' => $imageAttributes['title'] ?: $file->getProperty('title'), 'alt' => $imageAttributes['alt'] ?: $file->getProperty('alternative'), 'width' => $processedFile->getProperty('width'), 'height' => $processedFile->getProperty('height'), ]; $imageAttributes = array_merge($imageAttributes, $additionalAttributes); + } else { + $imageAttributes['src'] = $imageService->getImageUri($file); } } catch (Resource\Exception\FileDoesNotExistException $fileDoesNotExistException) { // Log the fact the file could not be retrieved. @@ -99,6 +105,7 @@ public function renderImageAttributes($content = '', $conf) } } } + return ''; } diff --git a/Resources/Public/JavaScript/Plugins/TableOperations.js b/Resources/Public/JavaScript/Plugins/TableOperations.js index 7ff6aa28..03201e62 100644 --- a/Resources/Public/JavaScript/Plugins/TableOperations.js +++ b/Resources/Public/JavaScript/Plugins/TableOperations.js @@ -1459,7 +1459,7 @@ define([ * @param {Object} params The field values entered in the form */ setHeaders: function (table, params) { - var headers = params.f_headers; + var headers = params.typeof; var doc = this.editor.document; var tbody = table.tBodies[0]; var thead = table.tHead;