TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper Class Reference

Public Member Functions

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

Protected Member Functions

 getTemporaryFilePath (TaskInterface $task)
 
 generatePreviewFromFile (File $file, array $configuration, $targetFilePath)
 

Protected Attributes

 $processor
 

Detailed Description

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

Definition at line 25 of file LocalPreviewHelper.php.

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ generatePreviewFromFile()

TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper::generatePreviewFromFile ( File  $file,
array  $configuration,
  $targetFilePath 
)
protected

◆ getTemporaryFilePath()

TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper::getTemporaryFilePath ( TaskInterface  $task)
protected

Returns the path to a temporary file for processing

Parameters
TaskInterface$task
Returns
string

Definition at line 75 of file LocalPreviewHelper.php.

References TYPO3\CMS\Core\Resource\Processing\TaskInterface\getTargetFileExtension(), and TYPO3\CMS\Core\Utility\GeneralUtility\tempnam().

Referenced by TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper\process().

◆ 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

Parameters
TaskInterface$task
Returns
array|NULL

Definition at line 49 of file LocalPreviewHelper.php.

References TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper\generatePreviewFromFile(), 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

◆ $processor

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