From 58ee06e684cdbb5db29f9c3d29b9f0cedded11d5 Mon Sep 17 00:00:00 2001 From: Torben Hansen <derhansen@gmail.com> Date: Thu, 14 Sep 2023 19:54:04 +0200 Subject: [PATCH] [TASK] Suggest PHP exif module in system environment status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the PHP exif module is installed, TYPO3 uses the `exif_read_data()` function of read exif metadata of images. In case of the image upload functionality in TYPO3, the `exif_read_data()` function is used to evaluate the `Orientation` exif property, which is used to decide, if the width and height of an image should be switched before the data is saved in the `sys_file_metadata` table. If the PHP exif module is not available, portrait images created by modern camera systems might be saved with wrong width and height, because the exif `Orientation` is not respected. This might result in rending of distorted images, when the uploaded image is processed by TYPO3 image rendering. With this change, the system environment check is extended to suggest to PHP exif module to be installed. If not available, a warning message is shown in the system environment check. Additionally, composer.json files of system extensions using exif related functions (is available) have been updated to suggest PHP ext-exif. Resolves: #101922 Releases: main Signed-off-by: Torben Hansen <derhansen@gmail.com> Change-Id: I26400c47b66185a0236bf72b9010d153c328c70b Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81022 Reviewed-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com> Tested-by: Guido Schmechel <guido.schmechel@brandung.de> Tested-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de> --- composer.json | 7 ++++--- typo3/sysext/core/composer.json | 1 + typo3/sysext/indexed_search/composer.json | 1 + typo3/sysext/install/Classes/SystemEnvironment/Check.php | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 1cf2312c37d6..6c6a305ec3d6 100644 --- a/composer.json +++ b/composer.json @@ -123,12 +123,13 @@ }, "suggest": { "ext-apcu": "Needed when non-default APCU based cache backends are used", - "ext-gd": "GDlib/Freetype is required for building images with text (GIFBUILDER) and can also be used to scale images", + "ext-exif": "Used to extract exif metadata (orientation) of uploaded images", "ext-fileinfo": "Used for proper file type detection in the file abstraction layer", - "ext-zlib": "TYPO3 uses zlib for amongst others output compression and un/packing t3x extension files", + "ext-gd": "GDlib/Freetype is required for building images with text (GIFBUILDER) and can also be used to scale images", + "ext-mysqli": "", "ext-openssl": "OpenSSL is required for sending SMTP mails over an encrypted channel endpoint", "ext-zip": "", - "ext-mysqli": "" + "ext-zlib": "TYPO3 uses zlib for amongst others output compression and un/packing t3x extension files" }, "provide": { "psr/http-factory-implementation": "1.0", diff --git a/typo3/sysext/core/composer.json b/typo3/sysext/core/composer.json index 8d5155b71da6..3e5569eccb81 100644 --- a/typo3/sysext/core/composer.json +++ b/typo3/sysext/core/composer.json @@ -78,6 +78,7 @@ }, "suggest": { "ext-apcu": "Needed when non-default APCU based cache backends are used", + "ext-exif": "Used to extract exif metadata 'Orientation' of uploaded images", "ext-fileinfo": "Used for proper file type detection in the file abstraction layer", "ext-gd": "GDlib/Freetype is required for building images with text (GIFBUILDER) and can also be used to scale images", "ext-mysqli": "", diff --git a/typo3/sysext/indexed_search/composer.json b/typo3/sysext/indexed_search/composer.json index 94ca834008fd..f6f197d35742 100644 --- a/typo3/sysext/indexed_search/composer.json +++ b/typo3/sysext/indexed_search/composer.json @@ -25,6 +25,7 @@ "typo3/cms": "*" }, "suggest": { + "ext-exif": "Used to extract exif metadata 'COMMENT' and 'ImageDescription' of uploaded images", "typo3/cms-scheduler": "For garbage collection of search statistics" }, "extra": { diff --git a/typo3/sysext/install/Classes/SystemEnvironment/Check.php b/typo3/sysext/install/Classes/SystemEnvironment/Check.php index f2620b507870..78bb709608e9 100644 --- a/typo3/sysext/install/Classes/SystemEnvironment/Check.php +++ b/typo3/sysext/install/Classes/SystemEnvironment/Check.php @@ -72,6 +72,7 @@ class Check implements CheckInterface * @var string[] */ protected $suggestedPhpExtensions = [ + 'exif' => 'This extension is used to detect the orientation of uploaded images.', 'fileinfo' => 'This extension is used for proper file type detection in the File Abstraction Layer.', 'openssl' => 'This extension is used for sending SMTP mails over an encrypted channel endpoint.', ]; -- GitLab