17 use \TYPO3\CMS\Core\Resource, \TYPO3\CMS\Core\Utility;
32 public function __construct() {
35 $this->logger = $logManager->getLogger(__CLASS__);
45 $canProcessTask = $task->
getType() ===
'Image';
46 $canProcessTask = $canProcessTask & in_array($task->
getName(), array(
'Preview',
'CropScaleMask'));
47 return $canProcessTask;
58 throw new \InvalidArgumentException(
'Cannot process task of type "' . $task->
getType() .
'.' . $task->
getName() .
'"', 1350570621);
62 $result = $helper->process($task);
66 } elseif (!empty(
$result[
'filePath']) && file_exists(
$result[
'filePath'])) {
71 array(
'width' => $imageDimensions[0],
'height' => $imageDimensions[1],
'size' => filesize(
$result[
'filePath']),
'checksum' => $task->
getConfigurationChecksum())
97 throw new \InvalidArgumentException(
'Cannot find helper for task name: "' . $taskName .
'"', 1353401352);
112 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'UTF8filesystem']) {
113 $currentLocale = setlocale(LC_CTYPE, 0);
114 setlocale(LC_CTYPE,
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'systemLocale']);
115 $escapedInputName = escapeshellarg($inputName);
116 setlocale(LC_CTYPE, $currentLocale);
118 $escapedInputName = escapeshellarg($inputName);
120 return $escapedInputName;
138 if (!
$GLOBALS[
'TYPO3_CONF_VARS'][
'GFX'][
'gdlib']) {
139 throw new \RuntimeException(
'TYPO3 Fatal Error: No gdlib. ' . $textline1 .
' ' . $textline2 .
' ' . $textline3, 1270853952);
142 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'GFX'][
'gdlib_png']) {
143 $im = imagecreatefrompng(PATH_typo3 .
'gfx/notfound_thumb.png');
145 $im = imagecreatefromgif(PATH_typo3 .
'gfx/notfound_thumb.gif');
148 $white = imageColorAllocate($im, 255, 255, 255);
149 $black = imageColorAllocate($im, 0, 0, 0);
154 imagefilledrectangle($im, $x, 9, 56, 16, $white);
155 imageString($im, $font, $x, 9, $textline1, $black);
158 imagefilledrectangle($im, $x, 19, 56, 26, $white);
159 imageString($im, $font, $x, 19, $textline2, $black);
162 imagefilledrectangle($im, $x, 29, 56, 36, $white);
163 imageString($im, $font, $x, 29, substr($textline3, -14), $black);
166 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'GFX'][
'gdlib_png']) {
167 imagePng($im, $filename);
169 imageGif($im, $filename);
177 static $graphicalFunctionsObject = NULL;
179 if ($graphicalFunctionsObject === NULL) {
183 return $graphicalFunctionsObject;
getHelperByTaskName($taskName)
getConfigurationChecksum()
static makeInstance($className)
getTemporaryImageWithText($filename, $textline1, $textline2, $textline3)
processTask(TaskInterface $task)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
canProcessTask(TaskInterface $task)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
getGraphicalFunctionsObject()