2 namespace TYPO3\CMS\Core\Resource\Processing;
32 public function __construct()
36 $this->logger = $logManager->getLogger(__CLASS__);
47 $canProcessTask = $task->
getType() ===
'Image';
48 $canProcessTask = $canProcessTask & in_array($task->
getName(), array(
'Preview',
'CropScaleMask'));
49 return $canProcessTask;
61 throw new \InvalidArgumentException(
'Cannot process task of type "' . $task->
getType() .
'.' . $task->
getName() .
'"', 1350570621);
68 $result = $helper->process($task);
69 if ($result === null) {
72 }
elseif (!empty($result[
'filePath']) && file_exists($result[
'filePath'])) {
77 array(
'width' => $imageDimensions[0],
'height' => $imageDimensions[1],
'size' => filesize($result[
'filePath']),
'checksum' => $task->
getConfigurationChecksum())
79 $task->
getTargetFile()->updateWithLocalFile($result[
'filePath']);
82 }
elseif (!empty($result[
'width']) && !empty($result[
'height']) && empty($result[
'filePath'])) {
107 $processingFolder = $task->
getTargetFile()->getStorage()->getProcessingFolder();
110 if ($processingFolder->hasFile($task->
getTargetFileName()) && $storage->getDriverType() ===
'Local') {
111 $processedFileIdentifier = rtrim($processingFolder->getIdentifier(),
'/') .
'/' . $task->
getTargetFileName();
112 $configuration = $storage->getConfiguration();
113 if ($configuration[
'pathType'] ===
'relative') {
114 $absoluteBasePath = PATH_site . $configuration[
'basePath'];
116 $absoluteBasePath = $configuration[
'basePath'];
118 $targetFile = $absoluteBasePath . ltrim($processedFileIdentifier,
'/');
124 'width' => $imageDimensions[0],
125 'height' => $imageDimensions[1],
126 'size' => filesize($targetFile),
148 case 'CropScaleMask':
152 throw new \InvalidArgumentException(
'Cannot find helper for task name: "' . $taskName .
'"', 1353401352);
176 $graphicalFunctions->getTemporaryImageWithText(
$filename, $textline1, $textline2, $textline3);
184 static $graphicalFunctionsObject = null;
186 if ($graphicalFunctionsObject === null) {
190 return $graphicalFunctionsObject;