Bug #68719
closedCropping Images in Backend, <f:uri.image> and <f:image> return different file urls
100%
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
Updated by Frans Saris over 9 years ago
- Status changed from New to Needs Feedback
Did you test on latest version 7.4?
I also advice to use <f:uri.image image="{file}" />
instead of the src and threatasreference.
Gr. Frans
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Gerrit Code Review over 9 years ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42337
Updated by Georg Ringer over 9 years ago
to test:
- create a content element with a cropped image
- look up in the DB the last sys_file_reference uid
- in any fluid template do this (replace 123 by the real uid)
<f:image src="123" treatIdAsReference="1" /> <img src="<f:uri.image src="123" treatIdAsReference="1" />" />
Updated by Georg Ringer over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset ce0dfc8e94408e209405eacf08e454323dc383ef.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed