‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Resource\Processing\SvgImageProcessor Class Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\Processing\SvgImageProcessor:
TYPO3\CMS\Core\Resource\Processing\ProcessorInterface

Public Member Functions

 canProcessTask (TaskInterface $task)
 
 processTask (TaskInterface $task)
 

Protected Member Functions

 applyCropping (TaskInterface $task, Area $cropArea, ImageDimension $imageDimension)
 
 checkForExistingTargetFile (TaskInterface $task)
 
 getFilenameForSvgCropScaleMask (TaskInterface $task)
 

Private Attributes

int $defaultSvgDimension = 64
 

Detailed Description

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.

Definition at line 34 of file SvgImageProcessor.php.

Member Function Documentation

◆ applyCropping()

TYPO3\CMS\Core\Resource\Processing\SvgImageProcessor::applyCropping ( TaskInterface  $task,
Area  $cropArea,
ImageDimension  $imageDimension 
)
protected

Create standalone wrapper files for SVGs. Cropped responsive images delivered via an tag or as a URI for a background image, need to be self-contained. Therefore we wrap a <svg> container around the original SVG content. A viewBox() crop is then applied to that container. The processed file will contain all the viewBox cropping information and thus transports intrinsic sizes for all variants of CSS processing (max/min width/height).

Definition at line 101 of file SvgImageProcessor.php.

References TYPO3\CMS\Core\Resource\Processing\TaskInterface\getConfigurationChecksum(), TYPO3\CMS\Core\Resource\Processing\SvgImageProcessor\getFilenameForSvgCropScaleMask(), TYPO3\CMS\Core\Resource\Processing\TaskInterface\getSourceFile(), TYPO3\CMS\Core\Resource\Processing\TaskInterface\getTargetFile(), TYPO3\CMS\Core\Resource\Processing\TaskInterface\getTargetFileName(), TYPO3\CMS\Core\Resource\Processing\TaskInterface\setExecuted(), and TYPO3\CMS\Core\Utility\GeneralUtility\writeFile().

Referenced by TYPO3\CMS\Core\Resource\Processing\SvgImageProcessor\processTask().

◆ canProcessTask()

TYPO3\CMS\Core\Resource\Processing\SvgImageProcessor::canProcessTask ( TaskInterface  $task)

◆ checkForExistingTargetFile()

TYPO3\CMS\Core\Resource\Processing\SvgImageProcessor::checkForExistingTargetFile ( TaskInterface  $task)
protected

◆ getFilenameForSvgCropScaleMask()

TYPO3\CMS\Core\Resource\Processing\SvgImageProcessor::getFilenameForSvgCropScaleMask ( TaskInterface  $task)
protected

Returns the filename for a cropped/scaled/masked file which will be put in typo3temp for the time being.

Definition at line 170 of file SvgImageProcessor.php.

References TYPO3\CMS\Core\Resource\Processing\TaskInterface\getTargetFile(), and TYPO3\CMS\Core\Resource\Processing\TaskInterface\getTargetFileExtension().

Referenced by TYPO3\CMS\Core\Resource\Processing\SvgImageProcessor\applyCropping().

◆ processTask()

Member Data Documentation

◆ $defaultSvgDimension

int TYPO3\CMS\Core\Resource\Processing\SvgImageProcessor::$defaultSvgDimension = 64
private

Definition at line 36 of file SvgImageProcessor.php.