diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd62b80..9729428 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: warning_severity: 6 editorconfig: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: editorconfig-checker/action-editorconfig-checker@main diff --git a/Classes/Command/ProcessQueueCommand.php b/Classes/Command/ProcessQueueCommand.php index 28c9d6f..a1b8d24 100644 --- a/Classes/Command/ProcessQueueCommand.php +++ b/Classes/Command/ProcessQueueCommand.php @@ -73,10 +73,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!empty($row['identifier']) || ($safeProcessing === false)) { $processedFile = $processedFileRepository->findByUid($row['uid']); - if (is_a($processedFile, ProcessedFile::class)) { - $templateRunner->setProcessedFile($processedFile); - $templateRunner->run(); - } + $templateRunner->setProcessedFile($processedFile); + $templateRunner->run(); } } $queryBuilder diff --git a/Classes/Templates/AvifTemplate.php b/Classes/Templates/AvifTemplate.php index 8f88b31..226972f 100644 --- a/Classes/Templates/AvifTemplate.php +++ b/Classes/Templates/AvifTemplate.php @@ -113,11 +113,11 @@ protected function convertImageUsingGd(string $quality, string $targetFile): boo /** @var Typo3Version $version */ $version = GeneralUtility::makeInstance(Typo3Version::class); if ($version->getMajorVersion() == 13) { - $graphicalFunctionsObject = GeneralUtility::makeInstance(GifBuilder::class);// @phpstan-ignore-line + $graphicalFunctionsObject = GeneralUtility::makeInstance(GifBuilder::class); } else { $graphicalFunctionsObject = GeneralUtility::makeInstance(GraphicalFunctions::class); } - $image = $graphicalFunctionsObject->imageCreateFromFile($this->imagePath);// @phpstan-ignore-line + $image = $graphicalFunctionsObject->imageCreateFromFile($this->imagePath); // Convert CMYK to RGB if (!imageistruecolor($image)) { imagepalettetotruecolor($image); diff --git a/Classes/Templates/WebpTemplate.php b/Classes/Templates/WebpTemplate.php index f9924e3..4848492 100644 --- a/Classes/Templates/WebpTemplate.php +++ b/Classes/Templates/WebpTemplate.php @@ -95,11 +95,20 @@ public function processFile(): void protected function convertImageUsingIm(string $options, string $targetFile): string { $graphicalFunctionsObject = GeneralUtility::makeInstance(GraphicalFunctions::class); - return $graphicalFunctionsObject->imageMagickExec( + $execResponse = $graphicalFunctionsObject->imageMagickExec( $this->imagePath, $targetFile, $options ); + + // imageMagickExec might return false. phpdoc of function imageMagickExec is wrong + // @phpstan-ignore identical.alwaysFalse + if ($execResponse === false) { + $this->logger->writeLog('convert error on ' . $targetFile, LogLevel::ERROR); + return ''; + } + + return $execResponse; } /** @@ -112,11 +121,11 @@ protected function convertImageUsingGd(string $quality, string $targetFile): boo if (function_exists('imagewebp') && defined('IMG_WEBP') && (imagetypes() & IMG_WEBP) === IMG_WEBP) { $version = GeneralUtility::makeInstance(Typo3Version::class); if ($version->getMajorVersion() == 13) { - $graphicalFunctionsObject = GeneralUtility::makeInstance(GifBuilder::class);// @phpstan-ignore-line + $graphicalFunctionsObject = GeneralUtility::makeInstance(GifBuilder::class); } else { $graphicalFunctionsObject = GeneralUtility::makeInstance(GraphicalFunctions::class); } - $image = $graphicalFunctionsObject->imageCreateFromFile($this->imagePath);// @phpstan-ignore-line + $image = $graphicalFunctionsObject->imageCreateFromFile($this->imagePath); // Convert CMYK to RGB if (!imageistruecolor($image)) { imagepalettetotruecolor($image); diff --git a/composer.json b/composer.json index e733c5f..55397aa 100644 --- a/composer.json +++ b/composer.json @@ -31,8 +31,9 @@ "issues": "https://github.com/sitegeist/image-jack/issues" }, "require": { - "php": ">=8.1.0", - "typo3/cms-core": "^12.4 || ^13.2" + "php": ">=8.2.0", + "typo3/cms-core": "^12.4 || ^13.4", + "typo3/cms-frontend": "^12.4 || ^13.4" }, "require-dev": { "editorconfig-checker/editorconfig-checker": "*", diff --git a/ext_localconf.php b/ext_localconf.php index f75570d..bfcb650 100755 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -6,7 +6,6 @@ use Sitegeist\ImageJack\Templates\JpegTemplate; use Sitegeist\ImageJack\Templates\PngTemplate; use Sitegeist\ImageJack\Templates\WebpTemplate; -use Sitegeist\ImageJack\Xclass\AmazonS3Driver; use Sitegeist\ImageJack\Xclass\LocalDriver; use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Log\Writer\FileWriter; @@ -52,7 +51,7 @@ if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredDrivers']['AusDriverAmazonS3'])) { $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][$GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredDrivers']['AusDriverAmazonS3']['class']] = [ - 'className' => AmazonS3Driver::class + 'className' => 'Sitegeist\ImageJack\Xclass\AmazonS3Driver' ]; }