LocalCropScaleMaskHelper

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

Table of Contents

Methods

process()  : array<string|int, mixed>|null
This method actually does the processing of files locally
processWithLocalFile()  : array<string|int, mixed>|null
Does the heavy lifting prescribed in processTask() except that the processing can be performed on any given local image
getConfigurationForImageCropScaleMask()  : array<string|int, mixed>
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<string|int, mixed>|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<string|int, mixed>|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<string|int, mixed>|null
Parameters
$task : TaskInterface
$originalFileName : string
Return values
array<string|int, mixed>|null

getConfigurationForImageCropScaleMask()

protected getConfigurationForImageCropScaleMask(ProcessedFile $processedFile, GifBuilder $gifBuilder) : array<string|int, mixed>
Parameters
$processedFile : ProcessedFile
$gifBuilder : GifBuilder
Return values
array<string|int, mixed>

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<string|int, mixed> $configuration) : string
Parameters
$parameters : string

The parameters to be modified (if required)

$configuration : array<string|int, mixed>

The TypoScript configuration of [IMAGE].file

Return values
string

        
On this page

Search results