Classes/Task/BatchResizeTask.php
public function execute()
    {
        $configuration = ConfigurationController::readConfiguration();

        $this->imageResizer = GeneralUtility::makeInstance(\Causal\ImageAutoresize\Service\ImageResizer::class);
        $this->imageResizer->initializeRulesets($configuration);

        if (empty($this->directories)) {
            // Process watched directories
            $directories = $this->imageResizer->getAllDirectories();
        } else {
            $directories = GeneralUtility::trimExplode(LF, $this->directories, true);
        }
        $processedDirectories = [];

        // Expand watched directories if they contain wildcard characters
        $expandedDirectories = [];
        foreach ($directories as $directory) {
            if (($pos = strpos($directory, '/*')) !== false) {
                $pattern = $this->imageResizer->getDirectoryPattern($directory);
                $basePath = substr($directory, 0, $pos + 1);

                $objects = new \RecursiveIteratorIterator(
                    new \RecursiveDirectoryIterator(PATH_site . $basePath),
                    \RecursiveIteratorIterator::SELF_FIRST
                );
                foreach ($objects as $name => $object) {
                    $relativePath = substr($name, strlen(PATH_site));
                    if (substr($relativePath, -2) === DIRECTORY_SEPARATOR . '.') {
                        if (preg_match($pattern, $relativePath)) {
                            $expandedDirectories[] = substr($relativePath, 0, -1);
                        }
                    }
                }
            } else {
                $expandedDirectories[] = $directory;
            }
        }
        $directories = $expandedDirectories;

        $success = true;
        foreach ($directories as $directory) {
            $skip = false;
            foreach ($processedDirectories as $processedDirectory) {
                if (GeneralUtility::isFirstPartOfStr($directory, $processedDirectory)) {
                    continue 2;
                }
            }

            // Execute bach resize
            $success |= $this->batchResizePictures($directory);
            $processedDirectories[] = $directory;
        }

        return $success;
    }
public function execute()
    {
        $configuration = ConfigurationController::readConfiguration();

        $this->imageResizer = GeneralUtility::makeInstance(\Causal\ImageAutoresize\Service\ImageResizer::class);
        $this->imageResizer->initializeRulesets($configuration);

        if (empty($this->directories)) {
            // Process watched directories
            $directories = $this->imageResizer->getAllDirectories();
        } else {
            $directories = GeneralUtility::trimExplode(LF, $this->directories, true);
        }
        $processedDirectories = [];

        // Expand watched directories if they contain wildcard characters
        $expandedDirectories = [];
        foreach ($directories as $directory) {
            if (($pos = strpos($directory, '/*')) !== false) {
                $pattern = $this->imageResizer->getDirectoryPattern($directory);
                $basePath = substr($directory, 0, $pos + 1);

                $objects = new \RecursiveIteratorIterator(
                    new \RecursiveDirectoryIterator(PATH_site . $basePath),
                    \RecursiveIteratorIterator::SELF_FIRST
                );
                foreach ($objects as $name => $object) {
                    $relativePath = substr($name, strlen(PATH_site));
                    if (substr($relativePath, -2) === DIRECTORY_SEPARATOR . '.') {
                        if (preg_match($pattern, $relativePath)) {
                            $expandedDirectories[] = substr($relativePath, 0, -1);
                        }
                    }
                }
            } else {
                $expandedDirectories[] = $directory;
            }
        }
        $directories = $expandedDirectories;

        $success = true;
        foreach ($directories as $directory) {
            $skip = false;
            foreach ($processedDirectories as $processedDirectory) {
                if (GeneralUtility::isFirstPartOfStr($directory, $processedDirectory)) {
                    continue 2;
                }
            }

            // Execute bach resize
            $success |= $this->batchResizePictures($directory);
            $processedDirectories[] = $directory;
        }

        return $success;
    }
Batch resize pictures, called by scheduler.

@return boolean true if task run was successful