imagetypo3typo3-8.xrtefal

FAL image resized in RTE


I've downloaded the extension: https://github.com/netresearch/t3x-rte_ckeditor_image/blob/master/README.md

The images are rendering correctly except the resizing.

When I right click on an image in BE then select "Image Properties" I see the option to edit Width, Height, Title and Alt text. The Title and Alt text are rendering on FE correctly but the width/height is the original image size.

E.g. Image original size 2000px by 1000px, use Image Properties to resize to 200px by 100px. Clicking the "Source" button in the RTE shows the width/height attributes have been correctly set. However on clicking Save and View Page the original 2000px by 1000px is displayed in BE and FE

Oddly enough, if I use the Source button to resize the image width/height attributes this is saved correctly. However my editors want to use the Image Properties selector

Any advice? I'm using TYPO3 version 8.7.10


Solution

  • Solved: the issue was that the absolute URL didn't match, so the magic image converter was using the original image dimensions when saving the image. See Line 393 onwards of RteHtmlParser.php

    if ($absoluteUrl == $originalImageFile->getPublicUrl() || $absoluteUrl == $siteUrl . $originalImageFile->getPublicUrl()) {
       ...
    }
    else {
        // Magic image case: get a processed file with the requested configuration
        $imageConfiguration = [
            'width' => $imgTagDimensions[0],
            'height' => $imgTagDimensions[1]
        ];
        $magicImage = $magicImageService->createMagicImage($originalImageFile, $imageConfiguration);
        $attribArray['width'] = $magicImage->getProperty('width');
        $attribArray['height'] = $magicImage->getProperty('height');
    

    Resolving the file URL corrected this issue