TYPO3
7.6
|
Public Member Functions | |
__construct (LocalImageProcessor $processor) | |
process (TaskInterface $task) | |
Protected Member Functions | |
getTemporaryFilePath (TaskInterface $task) | |
Protected Attributes | |
$processor | |
Helper for creating local image previews using TYPO3s image processing classes.
Definition at line 26 of file LocalPreviewHelper.php.
__construct | ( | LocalImageProcessor | $processor | ) |
LocalImageProcessor | $processor |
Definition at line 36 of file LocalPreviewHelper.php.
References LocalPreviewHelper\$processor.
|
protected |
Returns the path to a temporary file for processing
TaskInterface | $task |
Definition at line 85 of file LocalPreviewHelper.php.
References TaskInterface\getTargetFileExtension(), and GeneralUtility\tempnam().
Referenced by LocalPreviewHelper\process().
process | ( | TaskInterface | $task | ) |
This method actually does the processing of files locally
takes the original file (on 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 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.
TaskInterface | $task |
Definition at line 60 of file LocalPreviewHelper.php.
References MathUtility\forceIntegerInRange(), TaskInterface\getConfiguration(), TaskInterface\getSourceFile(), and LocalPreviewHelper\getTemporaryFilePath().
|
protected |
Definition at line 31 of file LocalPreviewHelper.php.
Referenced by LocalPreviewHelper\__construct().