diff --git a/typo3/sysext/core/Classes/DataHandling/DataHandler.php b/typo3/sysext/core/Classes/DataHandling/DataHandler.php index 8c35561158e32adfb93180c89de7a34bad5d32b5..53a2066e5551787659b633efbe8773fa56cf0d9b 100644 --- a/typo3/sysext/core/Classes/DataHandling/DataHandler.php +++ b/typo3/sysext/core/Classes/DataHandling/DataHandler.php @@ -9215,9 +9215,6 @@ class DataHandler implements LoggerAwareInterface * * The following cache_* are intentionally not cleared by 'all' * - * - imagesizes: Clearing this table would cause a lot of unneeded - * Imagemagick calls because the size information has - * to be fetched again after clearing. * - all caches inside the cache manager that are inside the group "system" * - they are only needed to build up the core system and templates. * If the group of system caches needs to be deleted explicitly, use diff --git a/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php b/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php index 1f32964d5a9462f635318077313bbf96be9d27f9..e418820dafdc843d85d7b7dbd95dac7e5bb4ac6b 100644 --- a/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php +++ b/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php @@ -15,7 +15,6 @@ namespace TYPO3\CMS\Core\Imaging; -use TYPO3\CMS\Core\Cache\CacheManager; use TYPO3\CMS\Core\Core\Environment; use TYPO3\CMS\Core\Type\File\ImageInfo; use TYPO3\CMS\Core\Utility\CommandUtility; @@ -28,7 +27,7 @@ use TYPO3\CMS\Core\Utility\StringUtility; * Standard graphical functions * * Class contains a bunch of cool functions for manipulating graphics with GDlib/Freetype and ImageMagick. - * VERY OFTEN used with gifbuilder that extends this class and provides a TypoScript API to using these functions + * VERY OFTEN used with gifbuilder that uses this class and provides a TypoScript API to using these functions */ class GraphicalFunctions { @@ -464,114 +463,24 @@ class GraphicalFunctions */ public function getImageDimensions($imageFile) { - $returnArr = null; preg_match('/([^\\.]*)$/', $imageFile, $reg); - if (file_exists($imageFile) && in_array(strtolower($reg[0]), $this->imageFileExt, true)) { - $returnArr = $this->getCachedImageDimensions($imageFile); - if (!$returnArr) { - $imageInfoObject = GeneralUtility::makeInstance(ImageInfo::class, $imageFile); - if ($imageInfoObject->getWidth()) { - $returnArr = [ - $imageInfoObject->getWidth(), - $imageInfoObject->getHeight(), - strtolower($reg[0]), - $imageFile, - ]; - $this->cacheImageDimensions($returnArr); - } else { - // Size could not be determined, return null instead of boolean - $returnArr = null; - } - } + if (!file_exists($imageFile)) { + return null; } - return $returnArr; - } - - /** - * Caches the result of the getImageDimensions function into the database. Does not check if the file exists. - * - * @param array $identifyResult Result of the getImageDimensions function - * - * @return bool always TRUE - */ - public function cacheImageDimensions(array $identifyResult) - { - $filePath = $identifyResult[3]; - $statusHash = $this->generateStatusHashForImageFile($filePath); - $identifier = $this->generateCacheKeyForImageFile($filePath); - - $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('imagesizes'); - $imageDimensions = [ - 'hash' => $statusHash, - 'imagewidth' => $identifyResult[0], - 'imageheight' => $identifyResult[1], - ]; - $cache->set($identifier, $imageDimensions); - - return true; - } - - /** - * Fetches the cached image dimensions from the cache. Does not check if the image file exists. - * - * @param string $filePath The absolute image file path - * - * @return array|bool an array where [0]/[1] is w/h, [2] is extension and [3] is the file name, - * or FALSE for a cache miss - */ - public function getCachedImageDimensions($filePath) - { - $statusHash = $this->generateStatusHashForImageFile($filePath); - $identifier = $this->generateCacheKeyForImageFile($filePath); - $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('imagesizes'); - $cachedImageDimensions = $cache->get($identifier); - if (!isset($cachedImageDimensions['hash'])) { - return false; - } - - if ($cachedImageDimensions['hash'] !== $statusHash) { - // The file has changed. Delete the cache entry. - $cache->remove($identifier); - $result = false; - } else { - preg_match('/([^\\.]*)$/', $filePath, $imageExtension); - $result = [ - (int)$cachedImageDimensions['imagewidth'], - (int)$cachedImageDimensions['imageheight'], - strtolower($imageExtension[0]), - $filePath, + // @todo: check if we actually need this, ass ImageInfo deals with this much more professionally + if (!in_array(strtolower($reg[0]), $this->imageFileExt, true)) { + return null; + } + $imageInfoObject = GeneralUtility::makeInstance(ImageInfo::class, $imageFile); + if ($imageInfoObject->isFile() && $imageInfoObject->getWidth()) { + return [ + $imageInfoObject->getWidth(), + $imageInfoObject->getHeight(), + $imageInfoObject->getExtension(), + $imageFile, ]; } - - return $result; - } - - /** - * Creates the key for the image dimensions cache for an image file. - * - * This method does not check if the image file actually exists. - * - * @param string $filePath Absolute image file path - * - * @return string the hash key (an SHA1 hash), will not be empty - */ - protected function generateCacheKeyForImageFile($filePath) - { - return sha1(PathUtility::stripPathSitePrefix($filePath)); - } - - /** - * Creates the status hash to check whether a file has been changed. - * - * @param string $filePath Absolute image file path - * - * @return string the status hash (an SHA1 hash) - */ - protected function generateStatusHashForImageFile($filePath) - { - $fileStatus = stat($filePath); - - return sha1($fileStatus['mtime'] . $fileStatus['size']); + return null; } /** diff --git a/typo3/sysext/core/Classes/Resource/Processing/LocalImageProcessor.php b/typo3/sysext/core/Classes/Resource/Processing/LocalImageProcessor.php index 728d3df950f8adff9e15ee064c95ca2046802cdb..614133b8078b1dc32a1aad2e57525d60f73ceb1c 100644 --- a/typo3/sysext/core/Classes/Resource/Processing/LocalImageProcessor.php +++ b/typo3/sysext/core/Classes/Resource/Processing/LocalImageProcessor.php @@ -17,7 +17,7 @@ namespace TYPO3\CMS\Core\Resource\Processing; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; -use TYPO3\CMS\Core\Imaging\GraphicalFunctions; +use TYPO3\CMS\Core\Type\File\ImageInfo; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -68,12 +68,12 @@ class LocalImageProcessor implements ProcessorInterface, LoggerAwareInterface $task->getTargetFile()->setUsesOriginalFile(); } elseif (!empty($result['filePath']) && file_exists($result['filePath'])) { $task->setExecuted(true); - $imageDimensions = $this->getGraphicalFunctionsObject()->getImageDimensions($result['filePath']); + $imageInformation = GeneralUtility::makeInstance(ImageInfo::class, $result['filePath']); $task->getTargetFile()->setName($task->getTargetFileName()); $task->getTargetFile()->updateProperties([ - 'width' => $imageDimensions[0] ?? 0, - 'height' => $imageDimensions[1] ?? 0, - 'size' => filesize($result['filePath']), + 'width' => $imageInformation->getWidth(), + 'height' => $imageInformation->getHeight(), + 'size' => $imageInformation->getSize(), 'checksum' => $task->getConfigurationChecksum(), ]); $task->getTargetFile()->updateWithLocalFile($result['filePath']); @@ -112,11 +112,11 @@ class LocalImageProcessor implements ProcessorInterface, LoggerAwareInterface // have no API for fetching file metadata from a remote file. $localProcessedFile = $storage->getFileForLocalProcessing($task->getTargetFile(), false); $task->setExecuted(true); - $imageDimensions = $this->getGraphicalFunctionsObject()->getImageDimensions($localProcessedFile); + $imageInformation = GeneralUtility::makeInstance(ImageInfo::class, $localProcessedFile); $properties = [ - 'width' => $imageDimensions[0] ?? 0, - 'height' => $imageDimensions[1] ?? 0, - 'size' => filesize($localProcessedFile), + 'width' => $imageInformation->getWidth(), + 'height' => $imageInformation->getHeight(), + 'size' => $imageInformation->getSize(), 'checksum' => $task->getConfigurationChecksum(), ]; $task->getTargetFile()->updateProperties($properties); @@ -146,9 +146,4 @@ class LocalImageProcessor implements ProcessorInterface, LoggerAwareInterface return $helper; } - - protected function getGraphicalFunctionsObject(): GraphicalFunctions - { - return GeneralUtility::makeInstance(GraphicalFunctions::class); - } } diff --git a/typo3/sysext/core/Configuration/DefaultConfiguration.php b/typo3/sysext/core/Configuration/DefaultConfiguration.php index 5d84d29fa3a4c115d85e6859afa2c90b73bd0768..dde0a42b743a4ed6c8d92f5bb700dab4985afe69 100644 --- a/typo3/sysext/core/Configuration/DefaultConfiguration.php +++ b/typo3/sysext/core/Configuration/DefaultConfiguration.php @@ -191,14 +191,6 @@ return [ ], 'groups' => ['pages'], ], - 'imagesizes' => [ - 'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, - 'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class, - 'options' => [ - 'defaultLifetime' => 0, - ], - 'groups' => ['lowlevel'], - ], 'assets' => [ 'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, 'backend' => \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend::class, diff --git a/typo3/sysext/core/Configuration/Services.yaml b/typo3/sysext/core/Configuration/Services.yaml index 064596be9916cf3766b0ec5df7b95c938fc3ced3..8f3b4606260cbb4a89a31df590164426537bad79 100644 --- a/typo3/sysext/core/Configuration/Services.yaml +++ b/typo3/sysext/core/Configuration/Services.yaml @@ -299,11 +299,6 @@ services: factory: ['@TYPO3\CMS\Core\Cache\CacheManager', 'getCache'] arguments: ['rootline'] - cache.imagesizes: - class: TYPO3\CMS\Core\Cache\Frontend\FrontendInterface - factory: ['@TYPO3\CMS\Core\Cache\CacheManager', 'getCache'] - arguments: ['imagesizes'] - cache.l10n: class: TYPO3\CMS\Core\Cache\Frontend\FrontendInterface factory: ['@TYPO3\CMS\Core\Cache\CacheManager', 'getCache'] diff --git a/typo3/sysext/core/Documentation/Changelog/13.0/Breaking-102009-ImagesizesCacheRemoved.rst b/typo3/sysext/core/Documentation/Changelog/13.0/Breaking-102009-ImagesizesCacheRemoved.rst new file mode 100644 index 0000000000000000000000000000000000000000..e121d0efeca9f287b72879ebd40e044376d470b2 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/13.0/Breaking-102009-ImagesizesCacheRemoved.rst @@ -0,0 +1,63 @@ +.. include:: /Includes.rst.txt + +.. _breaking-102009-1695376655: + +============================================ +Breaking: #102009 - imagesizes cache removed +============================================ + +See :issue:`102009` + +Description +=========== + +A cache layer called "imagesizes" was added in 2004 (= TYPO3 3.x) to cache +width and height of any kind of images - mostly generated by GIFBuilder or +ImageMagick. This was using the PHP function :php:`getimagesizes` or, if this +failed, ImageMagick identify command, which is costly. + +In 2012, the new processing layer for File Abstraction Layer (FAL - via +"sys_file_processedfile") was introduced with a more modern API, which persists +final information about processed images in a separate database table. + +Any kind of information processing then is first checked in FAL and then stored +again in `cache_imagesizes`. Some more files, which do not use FAL still utilize +this functionality, but the second level cache layer (by default in the database), +is unneeded nowadays. + +For this reason, the lowlevel cache "imagesizes" is removed along with some +methods which were not marked as internal, but marked public: + +- :php:`TYPO3\CMS\Core\Imaging\GraphicalFunctions->cacheImageDimensions()` +- :php:`TYPO3\CMS\Core\Imaging\GraphicalFunctions->getCachedImageDimensions()` + +The main entrypoint :php:`TYPO3\CMS\Core\Imaging\GraphicalFunctions->getImageDimensions()` +is still available but does not use a cache layer anymore. + + +Impact +====== + +Calling the removed public methods will result in a fatal PHP error. In addition, +accessing the database table directly or via TYPO3's CacheManager is not possible +anymore, as the "imagesizes" cache is removed. + + +Affected installations +====================== + +TYPO3 installations which use the cache directly or access these methods +directly, which is very very unlikely. + + +Migration +========= + +The now unused database tables are automatically removed when using the database +compare update is called. When trying to retrieve image dimensions, +the :php:`TYPO3\CMS\Core\Type\File\Imageinfo` PHP class should be used instead in +favor of the main GraphicalFunctions method. + +The removed methods should be moved also towards the :php:`Imageinfo` PHP class. + +.. index:: Database, PHP-API, PartiallyScanned, ext:core diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php index 5db361ea5cf0d08ffa088e2c6387a44e2aa4ab88..6b80dd8704d74b408a87cef52f807d654c21edbd 100644 --- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php +++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php @@ -57,6 +57,7 @@ use TYPO3\CMS\Core\Service\FlexFormService; use TYPO3\CMS\Core\Text\TextCropper; use TYPO3\CMS\Core\TimeTracker\TimeTracker; use TYPO3\CMS\Core\Type\BitSet; +use TYPO3\CMS\Core\Type\File\ImageInfo; use TYPO3\CMS\Core\TypoScript\TypoScriptService; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\DebugUtility; @@ -3658,8 +3659,17 @@ class ContentObjectRenderer implements LoggerAwareInterface $gifCreator->start($fileArray, $this->data); $theImage = $gifCreator->gifBuild(); if ($theImage !== '') { - $imageResource = $gifCreator->getGraphicalFunctions()->getImageDimensions(Environment::getPublicPath() . '/' . $theImage); - $imageResource['origFile'] = $theImage; + $fullPath = Environment::getPublicPath() . '/' . $theImage; + $imageInfo = GeneralUtility::makeInstance(ImageInfo::class, $fullPath); + if ($imageInfo->getWidth() > 0) { + $imageResource = [ + 0 => $imageInfo->getWidth(), + 1 => $imageInfo->getHeight(), + 2 => $imageInfo->getExtension(), + 3 => $fullPath, + 'origFile' => $theImage, + ]; + } } } } else { diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php index 67ef814e181f2a0375dd653ab22e5a5acb75f951..22a7847dba5372635fdb10d9916a2c796deb7587 100644 --- a/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php +++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php @@ -383,13 +383,6 @@ final class ContentObjectRendererTest extends UnitTestCase */ public function getImgResourceCallsGetImgResourcePostProcessHook(): void { - $cacheManagerMock = $this->getMockBuilder(CacheManager::class)->disableOriginalConstructor()->getMock(); - $cacheMock = $this->getMockBuilder(CacheFrontendInterface::class)->disableOriginalConstructor()->getMock(); - $cacheMock->method('get')->willReturn(false); - $cacheMock->method('set')->willReturn(false); - $cacheManagerMock->method('getCache')->with('imagesizes')->willReturn($cacheMock); - GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerMock); - $resourceFactory = $this->createMock(ResourceFactory::class); $this->subject->method('getResourceFactory')->willReturn($resourceFactory); diff --git a/typo3/sysext/install/Classes/Configuration/Cache/CustomCachePreset.php b/typo3/sysext/install/Classes/Configuration/Cache/CustomCachePreset.php index 56c57a678ffa36b5bbca9916a8b4534cc312c5cc..31044c14caf23cbd7d2ccd7c8c41216298c09bdc 100644 --- a/typo3/sysext/install/Classes/Configuration/Cache/CustomCachePreset.php +++ b/typo3/sysext/install/Classes/Configuration/Cache/CustomCachePreset.php @@ -31,7 +31,6 @@ class CustomCachePreset extends AbstractCustomPreset implements CustomPresetInte protected $configurationValues = [ 'SYS/caching/cacheConfigurations/hash/backend' => Typo3DatabaseBackend::class, 'SYS/caching/cacheConfigurations/pages/backend' => Typo3DatabaseBackend::class, - 'SYS/caching/cacheConfigurations/imagesizes/backend' => Typo3DatabaseBackend::class, 'SYS/caching/cacheConfigurations/rootline/backend' => Typo3DatabaseBackend::class, ]; } diff --git a/typo3/sysext/install/Classes/Configuration/Cache/DatabaseCachePreset.php b/typo3/sysext/install/Classes/Configuration/Cache/DatabaseCachePreset.php index 681efefdce85bf858aa28b8d8d045d5fea073d39..940dd4bf5c41ca17a34c3989d85d8108edc503c1 100644 --- a/typo3/sysext/install/Classes/Configuration/Cache/DatabaseCachePreset.php +++ b/typo3/sysext/install/Classes/Configuration/Cache/DatabaseCachePreset.php @@ -37,8 +37,6 @@ class DatabaseCachePreset extends AbstractPreset 'SYS/caching/cacheConfigurations/hash/backend' => Typo3DatabaseBackend::class, 'SYS/caching/cacheConfigurations/pages/backend' => Typo3DatabaseBackend::class, 'SYS/caching/cacheConfigurations/pages/options/compression' => true, - 'SYS/caching/cacheConfigurations/imagesizes/backend' => Typo3DatabaseBackend::class, - 'SYS/caching/cacheConfigurations/imagesizes/options/compression' => true, 'SYS/caching/cacheConfigurations/rootline/backend' => Typo3DatabaseBackend::class, 'SYS/caching/cacheConfigurations/rootline/options/compression' => true, ]; diff --git a/typo3/sysext/install/Classes/Configuration/Cache/FileCachePreset.php b/typo3/sysext/install/Classes/Configuration/Cache/FileCachePreset.php index fd53b8ec4bd771bdd8930d72a1aa530325ab1844..146ff564d3bbb25bc0f01a1eba47257db1821417 100644 --- a/typo3/sysext/install/Classes/Configuration/Cache/FileCachePreset.php +++ b/typo3/sysext/install/Classes/Configuration/Cache/FileCachePreset.php @@ -16,7 +16,6 @@ namespace TYPO3\CMS\Install\Configuration\Cache; use TYPO3\CMS\Core\Cache\Backend\FileBackend; -use TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend; use TYPO3\CMS\Install\Configuration\AbstractPreset; class FileCachePreset extends AbstractPreset @@ -38,8 +37,6 @@ class FileCachePreset extends AbstractPreset 'SYS/caching/cacheConfigurations/hash/backend' => FileBackend::class, 'SYS/caching/cacheConfigurations/pages/backend' => FileBackend::class, 'SYS/caching/cacheConfigurations/pages/options/compression' => '__UNSET', - 'SYS/caching/cacheConfigurations/imagesizes/backend' => SimpleFileBackend::class, - 'SYS/caching/cacheConfigurations/imagesizes/options/compression' => '__UNSET', 'SYS/caching/cacheConfigurations/rootline/backend' => FileBackend::class, 'SYS/caching/cacheConfigurations/rootline/options/compression' => '__UNSET', ]; diff --git a/typo3/sysext/install/Classes/Controller/EnvironmentController.php b/typo3/sysext/install/Classes/Controller/EnvironmentController.php index 080e1bf3deff4556787aac39d38d1e0c53442259..99240ee16781dd3d5950e95851aab94363e84b95 100644 --- a/typo3/sysext/install/Classes/Controller/EnvironmentController.php +++ b/typo3/sysext/install/Classes/Controller/EnvironmentController.php @@ -32,6 +32,7 @@ use TYPO3\CMS\Core\Mail\MailerInterface; use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessageQueue; use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; +use TYPO3\CMS\Core\Type\File\ImageInfo; use TYPO3\CMS\Core\Utility\CommandUtility; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -671,11 +672,11 @@ class EnvironmentController extends AbstractController $resultFile = $this->getImagesPath() . $imageService->filenamePrefix . StringUtility::getUniqueId($imageService->alternativeOutputKey . 'combine1') . '.jpg'; $imageService->combineExec($inputFile, $overlayFile, $maskFile, $resultFile); - $imResult = $imageService->getImageDimensions($resultFile); - if ($imResult) { + $imageInfo = GeneralUtility::makeInstance(ImageInfo::class, $resultFile); + if ($imageInfo->getWidth() > 0) { $result = [ 'fileExists' => true, - 'outputFile' => $imResult[3], + 'outputFile' => $resultFile, 'referenceFile' => self::TEST_REFERENCE_PATH . '/Combine-1.jpg', 'command' => $imageService->IM_commands, ]; @@ -707,11 +708,11 @@ class EnvironmentController extends AbstractController $resultFile = $this->getImagesPath() . $imageService->filenamePrefix . StringUtility::getUniqueId($imageService->alternativeOutputKey . 'combine2') . '.jpg'; $imageService->combineExec($inputFile, $overlayFile, $maskFile, $resultFile); - $imResult = $imageService->getImageDimensions($resultFile); - if ($imResult) { + $imageInfo = GeneralUtility::makeInstance(ImageInfo::class, $resultFile); + if ($imageInfo->getWidth() > 0) { $result = [ 'fileExists' => true, - 'outputFile' => $imResult[3], + 'outputFile' => $resultFile, 'referenceFile' => self::TEST_REFERENCE_PATH . '/Combine-2.jpg', 'command' => $imageService->IM_commands, ]; @@ -742,10 +743,9 @@ class EnvironmentController extends AbstractController $gifBuilder->makeBox($image, $conf, $workArea); $outputFile = $this->getImagesPath() . $gifBuilder->getGraphicalFunctions()->filenamePrefix . StringUtility::getUniqueId('gdSimple') . '.' . $gifOrPng; $gifBuilder->ImageWrite($image, $outputFile); - $imResult = $gifBuilder->getGraphicalFunctions()->getImageDimensions($outputFile); $result = [ 'fileExists' => true, - 'outputFile' => $imResult[3], + 'outputFile' => $outputFile, 'referenceFile' => self::TEST_REFERENCE_PATH . '/Gdlib-simple.' . $gifOrPng, 'command' => $gifBuilder->getGraphicalFunctions()->IM_commands, ]; @@ -770,10 +770,9 @@ class EnvironmentController extends AbstractController $gifBuilder->makeBox($image, $conf, $workArea); $outputFile = $this->getImagesPath() . $gifBuilder->getGraphicalFunctions()->filenamePrefix . StringUtility::getUniqueId('gdBox') . '.' . $gifOrPng; $gifBuilder->ImageWrite($image, $outputFile); - $imResult = $gifBuilder->getGraphicalFunctions()->getImageDimensions($outputFile); $result = [ 'fileExists' => true, - 'outputFile' => $imResult[3], + 'outputFile' => $outputFile, 'referenceFile' => self::TEST_REFERENCE_PATH . '/Gdlib-box.' . $gifOrPng, 'command' => $gifBuilder->getGraphicalFunctions()->IM_commands, ]; @@ -805,10 +804,9 @@ class EnvironmentController extends AbstractController $gifBuilder->makeText($image, $conf, $workArea); $outputFile = $this->getImagesPath() . $gifBuilder->getGraphicalFunctions()->filenamePrefix . StringUtility::getUniqueId('gdText') . '.' . $gifOrPng; $gifBuilder->ImageWrite($image, $outputFile); - $imResult = $gifBuilder->getGraphicalFunctions()->getImageDimensions($outputFile); $result = [ 'fileExists' => true, - 'outputFile' => $imResult[3], + 'outputFile' => $outputFile, 'referenceFile' => self::TEST_REFERENCE_PATH . '/Gdlib-text.' . $gifOrPng, 'command' => $gifBuilder->getGraphicalFunctions()->IM_commands, ]; @@ -851,10 +849,9 @@ class EnvironmentController extends AbstractController $gifBuilder->makeText($image, $conf, $workArea); $outputFile = $this->getImagesPath() . $gifBuilder->getGraphicalFunctions()->filenamePrefix . StringUtility::getUniqueId('gdNiceText') . '.' . $gifOrPng; $gifBuilder->ImageWrite($image, $outputFile); - $imResult = $gifBuilder->getGraphicalFunctions()->getImageDimensions($outputFile); $result = [ 'fileExists' => true, - 'outputFile' => $imResult[3], + 'outputFile' => $outputFile, 'referenceFile' => self::TEST_REFERENCE_PATH . '/Gdlib-niceText.' . $gifOrPng, 'command' => $gifBuilder->getGraphicalFunctions()->IM_commands, ]; @@ -910,10 +907,9 @@ class EnvironmentController extends AbstractController $gifBuilder->makeText($image, $conf, $workArea); $outputFile = $this->getImagesPath() . $gifBuilder->getGraphicalFunctions()->filenamePrefix . StringUtility::getUniqueId('GDwithText-niceText-shadow') . '.' . $gifOrPng; $gifBuilder->ImageWrite($image, $outputFile); - $imResult = $gifBuilder->getGraphicalFunctions()->getImageDimensions($outputFile); $result = [ 'fileExists' => true, - 'outputFile' => $imResult[3], + 'outputFile' => $outputFile, 'referenceFile' => self::TEST_REFERENCE_PATH . '/Gdlib-shadow.' . $gifOrPng, 'command' => $gifBuilder->getGraphicalFunctions()->IM_commands, ]; diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php index a4a7235066915e3d98dfa59d7f9f5e196d200ddd..5fd6e66e57518cf7f47af1fe48e43763ae041246 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php @@ -6059,4 +6059,18 @@ return [ 'Breaking-101955-RemovedPublicMethodsRelatedToImageGeneration.rst', ], ], + 'TYPO3\CMS\Core\Imaging\GraphicalFunctions->getCachedImageDimensions' => [ + 'numberOfMandatoryArguments' => 1, + 'maximumNumberOfArguments' => 1, + 'restFiles' => [ + 'Breaking-102009-ImagesizesCacheRemoved.rst', + ], + ], + 'TYPO3\CMS\Core\Imaging\GraphicalFunctions->cacheImageDimensions' => [ + 'numberOfMandatoryArguments' => 1, + 'maximumNumberOfArguments' => 1, + 'restFiles' => [ + 'Breaking-102009-ImagesizesCacheRemoved.rst', + ], + ], ];