.. 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. It 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
:sql:`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 entry point :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 :php:`GraphicalFunctions` method.

The removed methods should be moved also towards the :php:`Imageinfo` PHP class.

.. index:: Database, PHP-API, PartiallyScanned, ext:core
