SvgImageProcessor implements ProcessorInterface
Processes (scales) SVG Images files or crops them via \DOMDocument and creates a new locally created processed file which is then pushed into FAL again.
Table of Contents
Interfaces
- ProcessorInterface
- Interface for file processors. All classes capable of processing a file have to implement this interface.
Methods
- canProcessTask() : bool
- Returns TRUE if this processor can process the given task.
- processTask() : void
- Processes the given task.
- applyCropping() : void
- Create standalone wrapper files for SVGs.
- checkForExistingTargetFile() : bool
- Check if the target file that is to be processed already exists.
- getFilenameForSvgCropScaleMask() : string
- Returns the filename for a cropped/scaled/masked file which will be put in typo3temp for the time being.
Methods
canProcessTask()
Returns TRUE if this processor can process the given task.
public
canProcessTask(TaskInterface $task) : bool
Parameters
- $task : TaskInterface
Return values
boolprocessTask()
Processes the given task.
public
processTask(TaskInterface $task) : void
Parameters
- $task : TaskInterface
Tags
applyCropping()
Create standalone wrapper files for SVGs.
protected
applyCropping(TaskInterface $task, Area $cropArea, ImageDimension $imageDimension) : void
Cropped responsive images delivered via an tag or as a URI for a background image, need to be self-contained. Therefore we wrap a
Parameters
- $task : TaskInterface
- $cropArea : Area
- $imageDimension : ImageDimension
checkForExistingTargetFile()
Check if the target file that is to be processed already exists.
protected
checkForExistingTargetFile(TaskInterface $task) : bool
If it exists, use the metadata from that file and mark task as done.
Parameters
- $task : TaskInterface
Tags
Return values
boolgetFilenameForSvgCropScaleMask()
Returns the filename for a cropped/scaled/masked file which will be put in typo3temp for the time being.
protected
getFilenameForSvgCropScaleMask(TaskInterface $task) : string
Parameters
- $task : TaskInterface