ImageCropScaleMaskTask

class \TYPO3\CMS\Core\Resource\Processing\ImageCropScaleMaskTask

Extends
AbstractTask

A task that takes care of cropping, scaling and/or masking an image, whether its source is a FAL File or a resource outside the File Abstraction Layer.

Table of Contents

Properties

$configuration  : array
$executed  : bool
$sourceFile  : SystemResourceInterface
$successful  : bool
$targetFile  : ProcessedResourceInterface
$targetFileExtension  : string|null

Methods

__construct()  : mixed
fileNeedsProcessing()  : bool
We only have to trigger the file processing if the file either is new, does not exist or the original file has changed since the last processing run (the last case has to trigger a reprocessing even if the original file was used until now).
getConfiguration()  : array
Returns the configuration for this task.
getConfigurationChecksum()  : string
Returns the checksum for this task's configuration, also taking the file and task type into account.
getName()  : string
Returns the name of this task
getSourceFile()  : SystemResourceInterface
Returns the original file this task is based on.
getTargetFile()  : ProcessedResourceInterface
Returns the processed file this task is executed on.
getTargetFileExtension()  : string
Determines the file extension the processed file should have in the filesystem.
getTargetFilename()  : string
Returns the filename
getTargetFileName()  : string
Returns the name the processed file should have in the filesystem.
getType()  : string
Returns the type of this task
isExecuted()  : bool
Returns TRUE if this task has been executed, no matter if the execution was successful.
isSuccessful()  : bool
Returns TRUE if this task has been successfully executed. Only call this method if the task has been processed at all.
sanitizeConfiguration()  : void
Can be extended in the actual subclasses, but be careful on what to sanitize, as Processors might need information that you actually throw away.
setExecuted()  : void
Set this task executed. This is used by the Processors in order to transfer the state of this task to the file processing service.
determineTargetFileExtension()  : string
Gets the file extension the processed file should have in the filesystem by either using the configuration setting, or the extension of the original file.
getChecksumData()  : array
Sets parameters needed in the checksum. Can be overridden to add additional parameters to the checksum.

Properties

$configuration

protected array $configuration

$targetFileExtension

protected string|null $targetFileExtension

Methods

fileNeedsProcessing()

We only have to trigger the file processing if the file either is new, does not exist or the original file has changed since the last processing run (the last case has to trigger a reprocessing even if the original file was used until now).

public fileNeedsProcessing() : bool

Return values

bool

getConfiguration()

Returns the configuration for this task.

public getConfiguration() : array

Return values

array

getConfigurationChecksum()

Returns the checksum for this task's configuration, also taking the file and task type into account.

public getConfigurationChecksum() : string

Return values

string

getName()

Returns the name of this task

public getName() : string

Return values

string

getTargetFileExtension()

Determines the file extension the processed file should have in the filesystem.

public getTargetFileExtension() : string

Return values

string

getTargetFilename()

Returns the filename

public getTargetFilename() : string

Return values

string

getTargetFileName()

Returns the name the processed file should have in the filesystem.

public getTargetFileName() : string

Return values

string

getType()

Returns the type of this task

public getType() : string

Return values

string

isExecuted()

Returns TRUE if this task has been executed, no matter if the execution was successful.

public isExecuted() : bool

Return values

bool

isSuccessful()

Returns TRUE if this task has been successfully executed. Only call this method if the task has been processed at all.

public isSuccessful() : bool

Tags

throws
LogicException

If the task has not been executed already

Return values

bool

sanitizeConfiguration()

Can be extended in the actual subclasses, but be careful on what to sanitize, as Processors might need information that you actually throw away.

public sanitizeConfiguration() : void

Ensure that the processing configuration which is part of the hash sum is properly cast, so unnecessary duplicate images are not produced, see #80942

setExecuted()

Set this task executed. This is used by the Processors in order to transfer the state of this task to the file processing service.

public setExecuted(bool $successful) : void

Parameters

$successful : bool

Set this to FALSE if executing the task failed

determineTargetFileExtension()

Gets the file extension the processed file should have in the filesystem by either using the configuration setting, or the extension of the original file.

protected determineTargetFileExtension() : string

Return values

string

getChecksumData()

Sets parameters needed in the checksum. Can be overridden to add additional parameters to the checksum.

protected getChecksumData() : array

This should include all parameters that could possibly vary between different task instances, e.g. the TYPO3 image configuration in TYPO3_CONF_VARS[GFX] for graphic processing tasks.

A FAL File is keyed off its sys_file uid and modification time; a system resource has neither, so it is keyed off its own identifier and content hash instead.

Return values

array
On this page