diff --git a/Classes/Command/CompressImagesCommand.php b/Classes/Command/CompressImagesCommand.php index de764f2..6ea6ce4 100644 --- a/Classes/Command/CompressImagesCommand.php +++ b/Classes/Command/CompressImagesCommand.php @@ -95,8 +95,10 @@ protected function execute(InputInterface $input, OutputInterface $output): void foreach ($this->fileStorageRepository->findAll() as $fileStorage) { $excludeFolders = GeneralUtility::trimExplode(',', (string)$settings['excludeFolders'], true); $files = $this->fileRepository->findAllNonCompressedInStorageWithLimit($fileStorage, $limit, $excludeFolders); - $this->compressImages($files); - $this->clearPageCache(); + if (count($files) > 0) { + $this->compressImages($files); + $this->clearPageCache(); + } } }