#111102Introduce enums and content detection for image formats
Description
Problem
Image formats, their file extensions and their media types are passed around as strings. Every place that maps one to the other keeps a list of its own, for example GraphicsCanvas (GIFBUILDER, install tool) and the FileContentParser of Indexed Search, which handles jpg, jpeg and tif by hand.
The format of a file is taken from its name, so an image with a misleading file extension is handed to the wrong decoder.
Proposal
- Introduce the enums
Format,FileExtensionandMediaTypeinTYPO3\CMS\Core\Imaging. Each creates the others, ignoring case and a leading dot;Format::isLossy()tells whether a format is written with a quality. - Introduce
FormatDetector, which tells the format of a file from its content, without ImageMagick and without ext-fileinfo. - Use them in
GraphicsCanvas, which then loads images by their content, and in theFileContentParserof Indexed Search, which tells JPEG and TIFF images by their format.
Reviews 1
History 312
-
Benjamin Kott changed description <span data-processor="relativetime" data-value="2026-10-17T01:20:55+00:00" > 10/17/26, 01:20 </span>
-
Benjamin Kott changed description <span data-processor="relativetime" data-value="2026-10-17T01:24:48+00:00" > 10/17/26, 01:24 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 96772 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-17T01:29:44+00:00" > 10/17/26, 01:29 </span> -
Benjamin Kott changed description <span data-processor="relativetime" data-value="2026-10-17T01:33:03+00:00" > 10/17/26, 01:33 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 96772 <span data-processor="relativetime" data-value="2026-10-17T11:55:04+00:00" > 10/17/26, 11:55 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 96772 <span data-processor="relativetime" data-value="2026-10-19T14:51:54+00:00" > 10/19/26, 14:51 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 96772 <span data-processor="relativetime" data-value="2026-10-20T21:10:54+00:00" > 10/20/26, 21:10 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 96772 <span data-processor="relativetime" data-value="2026-10-20T21:59:08+00:00" > 10/20/26, 21:59 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 96772 <span data-processor="relativetime" data-value="2026-10-21T12:05:49+00:00" > 10/21/26, 12:05 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 96772 <span data-processor="relativetime" data-value="2026-10-21T17:33:54+00:00" > 10/21/26, 17:33 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 96772 <span data-processor="relativetime" data-value="2026-10-22T18:42:35+00:00" > 10/22/26, 18:42 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 96772 <span data-processor="relativetime" data-value="2026-11-09T00:31:13+00:00" > 11/09/26, 00:31 </span>