Project

General

Profile

Actions

Bug #68719

closed

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

Added by Elmar Putz over 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2015-08-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #68421: Missing use statement in Uri/ImageViewHelperClosedFrans Saris2015-07-21

Actions
Actions #1

Updated by Georg Ringer over 8 years ago

  • Assignee deleted (Georg Ringer)
Actions #2

Updated by Frans Saris over 8 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

Actions #3

Updated by Susanne Moog over 8 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #4

Updated by Gerrit Code Review over 8 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

Actions #5

Updated by Georg Ringer over 8 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" />" />

Actions #6

Updated by Georg Ringer over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF