public function getAdditionalFields(array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject)
    {
        $editCommand = version_compare(TYPO3_branch, '9.5', '>=')
            ? $parentObject->getCurrentAction() === Action::EDIT
            : $parentObject->CMD === 'edit';

        // Initialize selected fields
        if (!isset($taskInfo['scheduler_batchResize_directories'])) {
            $taskInfo['scheduler_batchResize_directories'] = $this->defaultDirectories;
            if ($editCommand) {
                /** @var $task \Causal\ImageAutoresize\Task\BatchResizeTask */
                $taskInfo['scheduler_batchResize_directories'] = $task->directories;
            }
        }
        if (!isset($taskInfo['scheduler_batchResize_excludeDirectories'])) {
            $taskInfo['scheduler_batchResize_excludeDirectories'] = $this->defaultExcludeDirectories;
            if ($editCommand) {
                /** @var $task \Causal\ImageAutoresize\Task\BatchResizeTask */
                $taskInfo['scheduler_batchResize_excludeDirectories'] = $task->excludeDirectories;
            }
        }

        // Create HTML form fields
        $additionalFields = [];

        // Directories to be processed
        $fieldName = 'tx_scheduler[scheduler_batchResize_directories]';
        $fieldId = 'scheduler_batchResize_directories';
        $fieldValue = trim($taskInfo['scheduler_batchResize_directories']);
        $fieldHtml = '<textarea class="form-control" rows="4" name="' . $fieldName . '" id="' . $fieldId . '">' . htmlspecialchars($fieldValue) . '</textarea>';
        $additionalFields[$fieldId] = [
            'code' => $fieldHtml,
            'label' => 'LLL:EXT:image_autoresize/Resources/Private/Language/locallang_mod.xlf:label.batchResize.directories',
        ];

        // Directories to be excluded
        $fieldName = 'tx_scheduler[scheduler_batchResize_excludeDirectories]';
        $fieldId = 'scheduler_batchResize_excludeDirectories';
        $fieldValue = trim($taskInfo['scheduler_batchResize_excludeDirectories']);
        $fieldHtml = '<textarea class="form-control" rows="4" name="' . $fieldName . '" id="' . $fieldId . '">' . htmlspecialchars($fieldValue) . '</textarea>';
        $additionalFields[$fieldId] = [
            'code' => $fieldHtml,
            'label' => 'LLL:EXT:image_autoresize/Resources/Private/Language/locallang_mod.xlf:label.batchResize.excludeDirectories',
        ];

        return $additionalFields;
    }