Example #1
0
 /**
  * Hook for uploaded files.
  *
  * {@inheritDoc}
  * @see \TYPO3\CMS\Core\Utility\File\ExtendedFileUtilityProcessDataHookInterface::processData_postProcessAction()
  */
 public function processData_postProcessAction($action, array $cmdArr, array $result, ExtendedFileUtility $parentObject)
 {
     if (!$this->confArray['keepOriginal']) {
         $files = array_pop($result);
         if (is_array($files)) {
             foreach ($files as $file) {
                 /** @var $file File */
                 $this->pngquantService->convertPngImage($file);
             }
         }
     }
 }
Example #2
0
 /**
  * Called from FileProcessingService signal dispatch, after image process.
  *
  * @param FileProcessingService $fileProcessingService
  * @param DriverInterface $driver
  * @param ProcessedFile $processedFile
  * @param FileInterface $file
  * @param string $context
  * @param array $configuration
  */
 public function postProcessFile(FileProcessingService $fileProcessingService, DriverInterface $driver, ProcessedFile $processedFile, FileInterface $file, $context, array $configuration)
 {
     if ($processedFile->exists() && !is_null($processedFile->getIdentifier()) && $processedFile->isUpdated()) {
         $this->pngquantService->convertPngImage($processedFile);
     }
 }
 /**
  * Convert PNG files from specified storage
  * @param int $storageUid
  */
 public function convertCommand($storageUid)
 {
     $this->pngquantService->convertStorage($storageUid);
 }