TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper Class Reference

Public Member Functions

 __construct (LocalImageProcessor $processor)
 
 process (TaskInterface $task)
 

Static Public Member Functions

static preProcessConfiguration (array $configuration)
 

Protected Member Functions

 getTemporaryFilePath (TaskInterface $task)
 

Protected Attributes

 $processor
 

Static Protected Attributes

static $defaultConfiguration
 

Detailed Description

Helper for creating local image previews using TYPO3s image processing classes.

Definition at line 26 of file LocalPreviewHelper.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper::__construct ( LocalImageProcessor  $processor)

Member Function Documentation

◆ getTemporaryFilePath()

◆ preProcessConfiguration()

static TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper::preProcessConfiguration ( array  $configuration)
static

Enforce default configuration for preview processing

Parameters
array$configuration
Returns
array

Definition at line 57 of file LocalPreviewHelper.php.

References TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange().

◆ process()

TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper::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.

Parameters
TaskInterface$task
Returns
array|NULL

Definition at line 84 of file LocalPreviewHelper.php.

References TYPO3\CMS\Core\Resource\Processing\TaskInterface\getConfiguration(), TYPO3\CMS\Core\Resource\Processing\TaskInterface\getSourceFile(), and TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper\getTemporaryFilePath().

Member Data Documentation

◆ $defaultConfiguration

TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper::$defaultConfiguration
staticprotected
Initial value:
= [
'width' => 64

Definition at line 33 of file LocalPreviewHelper.php.

◆ $processor

TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper::$processor
protected