TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
AbstractGraphicalTask.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Core\Resource\Processing;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 
26 abstract class AbstractGraphicalTask extends AbstractTask
27 {
32 
39  public function getTargetFilename()
40  {
41  return $this->getSourceFile()->getNameWithoutExtension()
42  . '_' . $this->getConfigurationChecksum()
43  . '.' . $this->getTargetFileExtension();
44  }
45 
52  public function getTargetFileExtension()
53  {
54  if (!isset($this->targetFileExtension)) {
55  $this->targetFileExtension = $this->determineTargetFileExtension();
56  }
57 
59  }
60 
68  protected function determineTargetFileExtension()
69  {
70  if (!empty($this->configuration['fileExtension'])) {
71  $targetFileExtension = $this->configuration['fileExtension'];
72  } elseif ($this->getSourceFile()->getType() === AbstractFile::FILETYPE_IMAGE) {
73  $targetFileExtension = $this->getSourceFile()->getExtension();
74  // If true, thumbnails from non-image files will be converted to 'png', otherwise 'gif'
75  } elseif ($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails_png']) {
76  $targetFileExtension = 'png';
77  } else {
78  $targetFileExtension = 'gif';
79  }
80  return $targetFileExtension;
81  }
82 }
if(TYPO3_MODE=== 'BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']