From 2537b6c31b0f6a9053caaca3021aa21fc9fc1fe2 Mon Sep 17 00:00:00 2001 From: Ulrich Mathes Date: Tue, 3 Feb 2026 12:05:40 +0100 Subject: [PATCH 1/4] [BUGFIX] check for false from imageMagickExec --- Classes/Templates/WebpTemplate.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Classes/Templates/WebpTemplate.php b/Classes/Templates/WebpTemplate.php index f9924e3..d8cdb18 100644 --- a/Classes/Templates/WebpTemplate.php +++ b/Classes/Templates/WebpTemplate.php @@ -95,11 +95,18 @@ 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 ); + + if ($execResponse === false) { + $this->logger->writeLog('convert error on ' . $targetFile, LogLevel::ERROR); + return ''; + } + + return $execResponse; } /** From 1aac3b082ccce664f1ca5108904543143d5a0dbd Mon Sep 17 00:00:00 2001 From: Ulrich Mathes Date: Tue, 3 Feb 2026 12:52:34 +0100 Subject: [PATCH 2/4] [BUGFIX] fix phpstan errors --- Classes/Command/ProcessQueueCommand.php | 6 ++---- Classes/Templates/AvifTemplate.php | 4 ++-- Classes/Templates/WebpTemplate.php | 6 ++++-- composer.json | 3 ++- ext_localconf.php | 3 +-- 5 files changed, 11 insertions(+), 11 deletions(-) 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 d8cdb18..4848492 100644 --- a/Classes/Templates/WebpTemplate.php +++ b/Classes/Templates/WebpTemplate.php @@ -101,6 +101,8 @@ protected function convertImageUsingIm(string $options, string $targetFile): str $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 ''; @@ -119,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..0623482 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,8 @@ }, "require": { "php": ">=8.1.0", - "typo3/cms-core": "^12.4 || ^13.2" + "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' ]; } From bc1de37b657fe3480682ecb312d4293d8a967d1c Mon Sep 17 00:00:00 2001 From: Ulrich Mathes Date: Tue, 3 Feb 2026 13:11:53 +0100 Subject: [PATCH 3/4] [BUGFIX] run editorconfig linting within ubuntu-latest --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From dacf1f0ff288473cc9a9bb17e4ea93e1f6874eab Mon Sep 17 00:00:00 2001 From: Ulrich Mathes Date: Tue, 3 Feb 2026 13:15:27 +0100 Subject: [PATCH 4/4] [BUGFIX] we need PHP 8.2 for "final readonly" class solves #17 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0623482..55397aa 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "issues": "https://github.com/sitegeist/image-jack/issues" }, "require": { - "php": ">=8.1.0", + "php": ">=8.2.0", "typo3/cms-core": "^12.4 || ^13.4", "typo3/cms-frontend": "^12.4 || ^13.4" },