Breaking: #101955 - Removed public methods related to Image Generation¶
See forge#101955
Description¶
For historical reasons, there is a PHP API class
\TYPO3\
which deals with general
imaging functionality such as converting, scaling or cropping images - mainly
with ImageMagick / GraphicsMagick as a basis. In addition, the PHP class
\TYPO3\
which works with instructions
originally built for use with TypoScript and image manipulation such as masking,
combining text with images based mainly on the PHP extension GDLib.
Even though TYPO3 works best having both GDLib and ImageMagick installed and properly configured, the inter-dependency within the TYPO3 Core API when to use what class has always been unclear - mostly because this functionality has not been cleaned up in the past 20 years.
For this reason, Gif
now contains all functionality related to
GDLib, and all related methods from GraphicalFunctions have been removed.
Graphical
thus is only contains ImageMagick/GraphicsMagick
functionality.
In addition, Gif
and Graphical
are now two separate classes
without inheritance, but utilizes the Composition pattern.
The following public methods from Graphical
have been removed:
\TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->adjust () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->apply Image Magick To PHPGif () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->apply Offset () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->autolevels () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->convert Color () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->copy Image Onto Image () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->crop () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->destroy () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->get Temporary Image With Text () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->hex Color () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->image Create From File () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->Image TTFBBox Wrapper () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->Image TTFText Wrapper () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->Image Write () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->input Levels () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->make Box () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->make Effect () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->make Ellipse () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->make Emboss () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->make Outline () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->make Shadow () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->make Text () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->mask Image Onto Image () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->output () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->output Levels () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->scale () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->split String () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->unify Colors () \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions:: read Png Gif ()
The following public properties from Graphical
have been removed:
\TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->col Map \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->h \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->map \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->save Alpha Layer \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->setup \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->truecolor Colors \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->w \TYPO3\
CMS\ Core\ Imaging\ Graphical Functions->work Area
The following public properties in Gif
have been removed:
\TYPO3\
CMS\ Frontend\ Imaging\ Gif Builder->char Range Map \TYPO3\
CMS\ Frontend\ Imaging\ Gif Builder->my Class Name
The following public properties in Gif
are now marked as protected:
\TYPO3\
CMS\ Frontend\ Imaging\ Gif Builder->char Range Map \TYPO3\
CMS\ Frontend\ Imaging\ Gif Builder->combined File Names \TYPO3\
CMS\ Frontend\ Imaging\ Gif Builder->combined Text Strings \TYPO3\
CMS\ Frontend\ Imaging\ Gif Builder->data \TYPO3\
CMS\ Frontend\ Imaging\ Gif Builder->default Work Area \TYPO3\
CMS\ Frontend\ Imaging\ Gif Builder->obj BB \TYPO3\
CMS\ Frontend\ Imaging\ Gif Builder->XY
Impact¶
When using the classes directly in PHP code of extensions, calling any of the methods or accessing / setting the affected properties will result in a PHP error.
Affected installations¶
TYPO3 installations with custom extensions utilizing the PHP API of these two classes directly.
For any usages of these classes via TypoScript or the File Abstraction Layer API will continue to work and are not affected by this breaking change.
Migration¶
Use static analysis tools such as PHPStan or Psalm to detect if PHP code of
custom extensions is affected, and make use of Gif
class instead of
Graphical
when needing GDLib functionality.