‪TYPO3CMS  10.4
AbstractGraphicalTask.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
26 {
30  protected ‪$targetFileExtension;
31 
38  public function ‪getTargetFilename()
39  {
41  . '_' . $this->‪getConfigurationChecksum()
42  . '.' . $this->‪getTargetFileExtension();
43  }
44 
51  public function ‪getTargetFileExtension()
52  {
53  if (!isset($this->targetFileExtension)) {
54  $this->targetFileExtension = $this->‪determineTargetFileExtension();
55  }
56 
58  }
59 
67  protected function ‪determineTargetFileExtension()
68  {
69  if (!empty($this->configuration['fileExtension'])) {
70  ‪$targetFileExtension = $this->configuration['fileExtension'];
71  } elseif (in_array($this->‪getSourceFile()->getExtension(), ['jpg', 'jpeg', 'png', 'gif'], true)) {
73  } elseif (empty($this->configuration['crop'])
74  && $this->‪getSourceFile()->getExtension() === 'svg'
75  ) {
77  } elseif (‪$GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails_png']) {
78  // If true, thumbnails from non-processable files will be converted to 'png', otherwise 'gif'
80  } else {
82  }
84  }
85 }
‪TYPO3\CMS\Core\Resource\Processing\AbstractGraphicalTask\getTargetFilename
‪string getTargetFilename()
Definition: AbstractGraphicalTask.php:37
‪TYPO3\CMS\Core\Resource\Processing\AbstractGraphicalTask\$targetFileExtension
‪string $targetFileExtension
Definition: AbstractGraphicalTask.php:29
‪TYPO3\CMS\Core\Resource\Processing\AbstractGraphicalTask
Definition: AbstractGraphicalTask.php:26
‪TYPO3\CMS\Core\Resource\Processing
Definition: AbstractGraphicalTask.php:16
‪TYPO3\CMS\Core\Resource\Processing\AbstractTask\getSourceFile
‪Resource File getSourceFile()
Definition: AbstractTask.php:163
‪TYPO3\CMS\Core\Resource\Processing\AbstractTask\getConfigurationChecksum
‪string getConfigurationChecksum()
Definition: AbstractTask.php:96
‪TYPO3\CMS\Core\Resource\Processing\AbstractGraphicalTask\determineTargetFileExtension
‪string determineTargetFileExtension()
Definition: AbstractGraphicalTask.php:66
‪TYPO3\CMS\Core\Resource\Processing\AbstractGraphicalTask\getTargetFileExtension
‪string getTargetFileExtension()
Definition: AbstractGraphicalTask.php:50
‪TYPO3\CMS\Core\Resource\AbstractFile\getExtension
‪string getExtension()
Definition: AbstractFile.php:254
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Resource\Processing\AbstractTask
Definition: AbstractTask.php:31
‪TYPO3\CMS\Core\Resource\AbstractFile\getNameWithoutExtension
‪string getNameWithoutExtension()
Definition: AbstractFile.php:173