LocalCropScaleMaskHelper

class \TYPO3\CMS\Core\Resource\Processing\LocalCropScaleMaskHelper

Helper class to locally perform a crop/scale/mask task with the TYPO3 image processing classes.

Table of Contents

Methods

process()  : array|null
This method actually does the processing of files locally
processWithLocalFile()  : array|null
Does the heavy lifting prescribed in processTask() except that the processing can be performed on any given local image
getConfigurationForImageCropScaleMask()  : array
getFilenameForImageCropScaleMask()  : string
Returns the filename for a cropped/scaled/masked file.
isTemporaryFile()  : bool
modifyImageMagickStripProfileParameters()  : string
Modifies the parameters for ImageMagick for stripping of profile information.

Methods

process()

This method actually does the processing of files locally

public process(TaskInterface $task) : array|null

Takes the original file (for remote storages this will be fetched from the remote server), does the IM magic on the local server by creating a temporary typo3temp/ file, copies the typo3temp/ file to the processing folder of the target storage and removes the typo3temp/ file.

The returned array has the following structure: width => 100 height => 200 filePath => /some/path

If filePath isn't set but width and height are the original file is used as ProcessedFile with the returned width and height. This is for example useful for SVG images.

Parameters

$task : TaskInterface

Return values

array|null

processWithLocalFile()

Does the heavy lifting prescribed in processTask() except that the processing can be performed on any given local image

public processWithLocalFile(TaskInterface $task, string $originalFileName) : array|null

Parameters

$task : TaskInterface
$originalFileName : string

Return values

array|null

getFilenameForImageCropScaleMask()

Returns the filename for a cropped/scaled/masked file.

protected getFilenameForImageCropScaleMask(TaskInterface $task) : string

Parameters

$task : TaskInterface

Return values

string

isTemporaryFile()

protected isTemporaryFile(string $filePath) : bool

Parameters

$filePath : string

Return values

bool

modifyImageMagickStripProfileParameters()

Modifies the parameters for ImageMagick for stripping of profile information.

protected modifyImageMagickStripProfileParameters(string $parameters, array $configuration) : string

Parameters

$parameters : string

The parameters to be modified (if required)

$configuration : array

The TypoScript configuration of [IMAGE].file

Return values

string
On this page