0

As topic says, I need to get only unprocessed PNG files.

My current approach is the following:

$fileExtensionFilter = $this->objectManager->get(FileExtensionFilter::class);
$fileExtensionFilter->setAllowedFileExtensions('png');

$storage->addFileAndFolderNameFilter([$fileExtensionFilter, 'filterFileList']);
$availablePngFiles = $storage->getFileIdentifiersInFolder($storage->getRootLevelFolder(false)->getIdentifier(), true, true);

foreach ($availablePngFiles as $pngFile) {
    if(!$storage->isWithinProcessingFolder($pngFile)) {
        $pngFileObject = $storage->getFile($pngFile);    
    }
}

So, it works, but I'd like to avoid the unnecessary isWithinProcessingFolder() lookup and get only the original unprocessed files, which will significantly reduce the number of loops.

Viktor Livakivskyi
  • 3,178
  • 1
  • 21
  • 33

1 Answers1

0

TYPO3 core 7.6.19 does only ship with two filters: FileExtensionFilter and FileNameFilter, which actually is a "hidden file filter".

You could write your own file filter and filter in there, but that's way more work than keeping those two lines of code.

cweiske
  • 30,033
  • 14
  • 133
  • 194