Issue Bug Closed

#68719Cropping Images in Backend, <f:uri.image> and <f:image> return different file urls

Elmar Putz 08/04/15, 12:13 updated 10/19/17, 21:59

Description

Hi,

i’m using the new crop feature in the backend for image manipulation in the backend. The output gets rendered via fluid template and there seems to be a problem with referencing the correct (= cropped) version of the file.

Correct, cropped version of image:

<f:image src="{image.uid}"  treatIdAsReference="1" /> 

Incorrect output of path to original file (uncropped version)

<f:uri.image  src="{image.uid}"  treatIdAsReference="1" />

My Extension uses the following method for fetching image data:

 public function getImages($id, $tablename = 'tt_content', $imageField = 'image') {

        /* elp: if image field from tt_content is used */
        /** @var $fileRepository \TYPO3\CMS\Core\Resource\FileRepository */
        $fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');

        $images = $fileRepository->findByRelation($tablename, $imageField, $id);
        $imagesArray = array();

        /** @var $image \TYPO3\CMS\Core\Resource\FileReference */
        foreach ($images as $key => $image) {
            $imagesArray[$key] = $image->getReferenceProperties();
        }

        return $imagesArray;
    }

I guess, both methods should return the same URL?

Elmar

Reviews 1