Project

General

Profile

Actions

Task #67754

closed

Cleanup "crop" implementation

Added by Bernhard Kraft almost 9 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Start date:
2015-06-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

For 7.3 an image "crop" functionality got added to the features of TYPO3.

The current implemntation is not really a neat one. Let me point out why.

First a rather strange construct had to get added at at least two different placed in the core:

1. line 106 of ImageViewHelper:
https://git.typo3.org/Packages/TYPO3.CMS.git/blob/refs/heads/TYPO3_7-3:/typo3/sysext/fluid/Classes/ViewHelpers/ImageViewHelper.php#l106

2. method "getImgResource" of "ContentObjectRenderer"
https://git.typo3.org/Packages/TYPO3.CMS.git/blob/refs/heads/TYPO3_7-3:/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#l5477

Instead of this solution ContentObjectRenderer and Extbase\Service\Image\ImageService should have get changed to pass any FileReference along to the ImageProcessingService.

For this to work a few issues would have to get taken care of:

1. The "Resource\FileReference" class will require a "process" method similar to that of Resource\File

2. The "Resource\ProcessedFileRepository" will need to take care of both: Resource\File and Resource\FileReference

3. The "Resourcce\Processing\LocalCropScaleMaskHelper" class would have to get modified to take care of a FileReference and use the crop-property of the FileReference if not overruled by configuration.

When those changes get applied cropping would be implemented cleanly at one single location/class.


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Task #54229: Refactor Processor Registry like the Extractor registryClosedSteffen Ritter2014-03-11

Actions
Related to TYPO3 Core - Bug #76659: Click-Enlarge does not show cropped imageClosed2016-06-16

Actions
Related to TYPO3 Core - Feature #70858: Add possibility to "hook" into the processing chain Closed2015-10-20

Actions
Actions #1

Updated by Bernhard Kraft almost 9 years ago

Having this change integrated it would also be possible to add custom field to FileReferences and then get them handled from within any slot attaching to the "emitPreProcessFile" signal.

Actions #2

Updated by Frans Saris almost 9 years ago

Maybe we can have another look at this when we proceed with #54229

Actions #3

Updated by Bernhard Kraft almost 9 years ago

#54229 seems something REALLY required.

The current file processing mechanism is mostly unflexible.

For example it is almost impossible to process a file twice.

I used the "preProcess" slot of the FileProcessingService to hook in a custom method. Altough I already modified (overridden) the ImageService class of extbase to pass along the FileReference it seemed almost impossible to process a file two times. Reason:

When a file gets processed it will be put under the processed folder of its storage. When you then need to process the file again it is not possible to retrieve a "Resource\File" object for the processed file by any means (Except large scale xclassing). The ResourceFactory methods for retrieving a file will always return a "ProcessedFile" instance instead.

So for processing the file again I had to create a second Resource-Storage record and have it assigned a different processed folder (alt_processed). Then I could request my alternative Resource-Storage for the already processed file and got a Resource\File object back which I could then process again (and having the result put in _alt_processed).

Actions #4

Updated by Benni Mack over 8 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #5

Updated by Riccardo De Contardi over 8 years ago

  • Target version changed from 7 LTS to Candidate for Major Version
Actions #6

Updated by Frans Saris over 7 years ago

  • Parent task set to #77810
Actions #7

Updated by Frans Saris over 7 years ago

  • Parent task deleted (#77810)
Actions #8

Updated by Susanne Moog about 5 years ago

  • Related to Feature #70858: Add possibility to "hook" into the processing chain added
Actions #9

Updated by Susanne Moog about 5 years ago

  • Status changed from New to Closed

As this is a technical ticket with no one working on it for the last 3 years, I'm going to close the issue now. If someone wants to start work on it, pushing a patch will reopen the issue.

Actions

Also available in: Atom PDF