Issue Task Closed

#67754Cleanup "crop" implementation

Bernhard Kraft 06/25/15, 18:00 updated 03/07/19, 08:53

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.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.