96772[FEATURE] Add an enum and detection for image formats
Commit message
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 9
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/72/96772/9 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/72/96772/9 && git cherry-pick FETCH_HEAD
Review
-
Code review CR 0 Needs a vote
-
Verified V 0 Needs a vote
- core-ci +1 CI
Relation chain 7
-
main
96780[!!!][TASK] Rename GFX/processor_effects to GFX/sharpen
The chain has patch set 2 of 7, the changes above it need a rebase.
-
main
96773[BUGFIX] Let GD sharpening grow with its strength
The chain has patch set 3 of 8, the changes above it need a rebase.
-
main
96778[!!!][TASK] Remove the GFX setting thumbnails
The chain has patch set 4 of 5, the changes above it need a rebase.
-
main
96777[!!!][TASK] Require the PHP extension gd
The chain has patch set 1 of 2, the changes above it need a rebase.
- main 93628[WIP][TASK] Make GD the baseline image processor
- main 96776[TASK] Read image orientation independently of ext-exif
-
96772 [FEATURE] Add an enum and detection for image formats This change
Merge conflicts 6
- main 97467[BUGFIX] Map MIME types of uploads by the target file extension
- main 93628[WIP][TASK] Make GD the baseline image processor
- main 95105[TASK] Apply PHP code simplifications
- main 92589[TASK] Replace unneeded instanceof on xxx|null. Use a null check instead
- main 90461[WIP][BUGFIX] Allow to set context in test mail environment
- main 69092[WIP][TASK] Implement install tool layout boilerplate as web components
Issues 1
Files 44
- typo3/sysext/core/Classes/Imaging/Format.php1new+197 −0
- typo3/sysext/core/Classes/Imaging/FormatDetector.phpnew+136 −0
- typo3/sysext/core/Classes/Imaging/GraphicsCanvas.php+51 −44
- typo3/sysext/core/Classes/Type/File/FileInfo.php+18 −6
- typo3/sysext/core/Documentation/Changelog/15.0/Feature-111102-IntroduceAnImageFormatEnumAndContentDetection.rstnew+100 −0
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/bom.svgnew+2 −0
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/container.jxlnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/empty.pngnew+0 −0
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/html.gifnew+2 −0
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/illustration.ainewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.avifnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.bmpnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.gifnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.heicnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.iconewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.jp2newbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.jpgnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.jxlnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.pcxnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.pdfnewbinary
Show 24 more files
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.pngnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.svgnew+1 −0
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.tganewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.tifnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/image.webpnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/mif1-brand.avifnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/msl.pngnew+5 −0
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/mvg.svg3new+4 −0
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/png-contentnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/png-content.jpgnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/postscript.jpgnew+4 −0
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/tga-content.binnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/truncated.pngnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/UPPER.JPGnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/UPPER.TGAnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Detection/viewbox-only.svgnew+1 −0
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/Orientation/RightTop.jpgnewbinary
- typo3/sysext/core/Tests/Unit/Imaging/Fixtures/RecordingStreamWrapper.phpnew+64 −0
- typo3/sysext/core/Tests/Unit/Imaging/FormatDetectorTest.phpnew+161 −0
- typo3/sysext/core/Tests/Unit/Imaging/FormatTest.phpnew+206 −0
- typo3/sysext/core/Tests/Unit/Imaging/GraphicsCanvasTest.php+42 −1
- typo3/sysext/core/Tests/Unit/Type/File/FileInfoTest.phpnew+85 −0
- typo3/sysext/frontend/Classes/Imaging/GifBuilder.php+2 −1
- typo3/sysext/install/Classes/Controller/EnvironmentController.php+6 −5
Review log 1827
Show 12 earlier messages
-
Benjamin Kott uploaded patch set 1 10/17/26, 01:29
-
core-ci voted on patch set 1 V +1 10/17/26, 01:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111410
-
Benjamin Kott rebased onto patch set 2
V +110/17/26, 11:55 -
core-ci voted on patch set 2 V +1 10/17/26, 12:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111450
-
Simon Schaufelberger commented on patch set 2 10/17/26, 12:17
-
Garvin Hicking commented on patch set 2 10/17/26, 12:25
I'm a bit afraid we lock ourselves into reinventing our own mime.types wheel and need to harmonize that, fixating supported image formats to a specific TYPO3 version. Not sure yet how we could solve it: make an own extension out of it, supporting multiple cores? Making them configurable? Adding easy mappings for future formats? We've failed on this when lagging behing webp and avif/heic. Given AI speed cycles I'm afraid we'll lag behind future formats. What are your thoughts? (I have only briefly glanced at this and wanted to raise this topic before merging) -
Benjamin Kott commented on patch set 2 10/17/26, 13:39
mvg.svg:1ReplyIt is indeed not an SVG at all. It is an ImageMagick MVG script named .svg, the ImageTragick attack vector. ImageMagick recognises MVG by its content and runs it. The test proves FormatDetector returns null for it, so such a file never reaches a decoder. -
Benjamin Kott commented on patch set 2 10/17/26, 13:51
Reply
The goal is to bundle image handling, and for that TYPO3 needs more than media types: - what a file really is, - who can read and write it, - whether it's lossy, - whether browsers display it. Today that's scattered as string lists across the core. Even AVIF isn't handled correctly everywhere yet; that follows later in this chain. New formats will still need work beyond adding a case, and we'll have to adjust again in the future. But with Format as the shared vocabulary, it happens in one known place instead of across the core. -
Garvin Hicking commented on patch set 2 10/17/26, 15:29
Reply
How about an external typo3/media package for these structures then, maybe merging it with typo3/icons (or how's it called)? Then we can maintain that vocabulary with more compatibility and be faster to adjust formats across major versions of TYPO3. -
Simon Schaufelberger commented on patch set 2 10/17/26, 16:04
mvg.svg:1ReplyAcknowledged -
Benjamin Kott commented on patch set 2 10/17/26, 18:17
Reply
Extracting is maybe an option later on once everything is settled but it also would mean that we extract the complete image handling and move it into a dedicated package. I cannot see the benefits yet and think it will make it more complex and slow. -
Garvin Hicking commented on patch set 2 10/17/26, 21:17
Reply
Can we combine this with https://review.typo3.org/c/Packages/TYPO3.CMS/+/96800 at least? That one also basically cries for being maintained independently from TYPO3 releases (to me). I think we should aim for being able to support new formats with quicker turnarounds and not move slowly with LTS releases. To me that's a huge benefit, if we find a data structure that is capable of being extensible. I don't think we'd need to rip out the whole image processing into its own package. But then again, the whole image rework as to my knowledge was aimed to replace exactly that in our Core-facing API, to allow for other implementations. I'll resolve this one here, I'm not deep enough into the patch and I think I'm approaching it with a different mindset and will not be blocking efforts. -
Benjamin Kott uploaded patch set 3
V +110/19/26, 14:51 -
core-ci voted on patch set 3 V +1 10/19/26, 15:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111662
-
Garvin Hicking commented on patch set 3 10/19/26, 20:56
Format.php:55UnresolvedCould we move these two definitions to either TYPO3_CONF_VARS just like allowedMimeTypes for forward compat of new mime types or file extensions? Or use a custom dedicated PHP file in config/system that could override this here if present? -
Benjamin Kott rebased onto patch set 4
V +110/20/26, 21:10 -
core-ci voted on patch set 4 V -1 10/20/26, 21:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111940
-
Benjamin Kott rebased onto patch set 5
V -110/20/26, 21:59 -
core-ci voted on patch set 5 V +1 10/20/26, 22:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111945
-
Benjamin Kott rebased onto patch set 6
V +110/21/26, 12:05 -
core-ci voted on patch set 6 V +1 10/21/26, 12:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112002
-
Benjamin Kott rebased onto patch set 7
V +110/21/26, 17:33 -
core-ci voted on patch set 7 V +1 10/21/26, 17:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112026
-
Benjamin Kott rebased onto patch set 8
V +110/22/26, 18:42 -
core-ci voted on patch set 8 V +1 10/22/26, 19:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112171
-
Benjamin Kott uploaded patch set 9
V +111/09/26, 00:31 -
core-ci voted on patch set 9 V +1 11/09/26, 00:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113612
mvg.svg:1