93666[BUGFIX] Route GifBuilder through a pure-GD canvas
Commit message
Review
-
Code review CR +2 Done
- Benjamin Kott +2
- Georg Ringer +1
- Andreas Kienast +1
-
Verified V +2 Done
- Benjamin Kott +2
- Georg Ringer +1
- Andreas Kienast +1
- core-ci +1 CI
Issues 1
Files 34
- Build/Sources/Sass/component/_example.scss+22 −4
- Build/Sources/Sass/module/_install.scss+0 −10
- Build/Sources/TypeScript/styleguide/gif-builder-code-modal.tsnew+39 −0
- typo3/sysext/backend/Classes/ViewHelpers/ThumbnailViewHelper.php2+5 −0
- typo3/sysext/backend/Resources/Public/Css/backend.css+6 −4
- typo3/sysext/backend/Resources/Public/Images/bg_transparent_emulation.pngdeletedbinary
- typo3/sysext/backend/Tests/Functional/ViewHelpers/Fixtures/ThumbnailViewHelper/Folders/fileadmin/user_upload/ThumbnailViewHelperFalTest.pdfnewbinary
- typo3/sysext/backend/Tests/Functional/ViewHelpers/Fixtures/ThumbnailViewHelper/Folders/fileadmin/user_upload/ThumbnailViewHelperFalTest.txtnew+1 −0
- typo3/sysext/backend/Tests/Functional/ViewHelpers/Fixtures/ThumbnailViewHelper/fal_document.csvnew+23 −0
- typo3/sysext/backend/Tests/Functional/ViewHelpers/Fixtures/ThumbnailViewHelper/fal_pdf.csvnew+23 −0
- typo3/sysext/backend/Tests/Functional/ViewHelpers/ThumbnailViewHelperTest.php+34 −0
- typo3/sysext/core/Classes/Imaging/GraphicsCanvas.php10new+1126 −0
- typo3/sysext/core/Tests/Unit/Imaging/GraphicsCanvasTest.phpnew+403 −0
- typo3/sysext/frontend/Classes/Imaging/GifBuilder.php2+252 −582
- typo3/sysext/frontend/Tests/Functional/Imaging/GifBuilderTest.php+228 −0
- typo3/sysext/install/Classes/Controller/EnvironmentController.php+95 −177
- typo3/sysext/install/Resources/Private/Templates/Environment/ImageProcessing.fluid.html+3 −10
- typo3/sysext/install/Resources/Public/Images/TestInput/Test.webpbinary
- typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-box.avifbinary
- typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-box.webpbinary
Show 14 more files
- typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-niceText.pngbinary
- typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-shadow.pngbinary
- typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-text.pngbinary
- typo3/sysext/styleguide/Classes/Controller/GraphicalFunctionsController.php10new+770 −0
- typo3/sysext/styleguide/Configuration/Backend/Modules.php+13 −0
- typo3/sysext/styleguide/Resources/Private/Language/Modules/graphical_functions.xlfnew+17 −0
- typo3/sysext/styleguide/Resources/Private/Language/locallang.xlf+6 −0
- typo3/sysext/styleguide/Resources/Private/Templates/Backend/GraphicalFunctions/GifBuilder.fluid.html1new+86 −0
- typo3/sysext/styleguide/Resources/Public/Images/GraphicsTest/background-orange.gifnewbinary
- typo3/sysext/styleguide/Resources/Public/Images/GraphicsTest/colorbars.pngnewbinary
- typo3/sysext/styleguide/Resources/Public/Images/GraphicsTest/mask-black-white.gifnewbinary
- typo3/sysext/styleguide/Resources/Public/Images/GraphicsTest/test.jpgnewbinary
- typo3/sysext/styleguide/Resources/Public/JavaScript/gif-builder-code-modal.jsnew+13 −0
- typo3/sysext/workspaces/Classes/Service/GridDataService.php2+10 −7
Review log 4971
Show 3046 earlier messages
-
Benjamin Kott uploaded patch set 1 04/14/26, 13:05
-
Benjamin Kott rebased onto patch set 2 04/14/26, 13:11
-
core-ci voted on patch set 1 V -1 04/14/26, 13:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100160
-
core-ci voted on patch set 2 V -1 04/14/26, 13:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100162
-
Christian Kuhn voted on patch set 2 CR -2 04/14/26, 13:39
-
Benjamin Kott uploaded patch set 3
V -104/14/26, 14:33Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 3 V +1 04/14/26, 14:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100170
-
Benjamin Kott uploaded patch set 4
V +104/14/26, 15:35Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 4 V -1 04/14/26, 15:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100172
-
Christian Kuhn commented on patch set 4 CR -2 04/14/26, 17:17
-2 for now since we need to communicate and coordinate these internally first: https://review.typo3.org/c/Packages/TYPO3.CMS/+/93666 https://review.typo3.org/c/Packages/TYPO3.CMS/+/93664 https://review.typo3.org/c/Packages/TYPO3.CMS/+/93628 -
Benjamin Kott uploaded patch set 5
V -104/14/26, 23:02Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Benjamin Kott updated the commit message in patch set 6 04/14/26, 23:05
Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 5 V +1 04/14/26, 23:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100210
-
core-ci voted on patch set 6 V +1 04/14/26, 23:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100211
-
Benjamin Kott uploaded patch set 7
V +104/15/26, 00:41Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 7 V +1 04/15/26, 00:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100214
-
Benjamin Kott rebased onto patch set 8
V +104/15/26, 09:02Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 8 V +1 04/15/26, 09:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100238
-
Benjamin Kott uploaded patch set 9
V +104/16/26, 12:58Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Benjamin Kott uploaded patch set 10 04/16/26, 13:24
Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 10 V +1 04/16/26, 13:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100321
-
core-ci voted on patch set 9 V +1 04/16/26, 13:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100319
-
Benjamin Kott uploaded patch set 11
V +104/16/26, 13:46Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Benjamin Kott uploaded patch set 12 04/16/26, 13:59
Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 11 V +1 04/16/26, 14:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100327
-
core-ci voted on patch set 12 V +1 04/16/26, 14:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100329
-
Benjamin Kott uploaded patch set 13
V +104/20/26, 06:44Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 13 V +1 04/20/26, 07:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100509
-
Benjamin Kott uploaded patch set 14
V +104/20/26, 21:17Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 14 V +1 04/20/26, 21:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100602
-
Benjamin Kott commented on patch set 14 05/05/26, 09:11
How do we proceed here? Processing is still blocked here. -
Garvin Hicking commented on patch set 14 05/29/26, 10:24
When I open the styleguide "graphical functions" layer (that I now understand why it's there and not in "environment") and scroll in the modal popup, close the modal popup, I can no longer scroll in the regular interface. -
Garvin Hicking commented on patch set 14 05/29/26, 11:18
ThumbnailViewHelper.php:102from my understanding this would prevent image processor that for example turn a PDF file into a thumbnail?!GraphicsCanvas.php:38I know this would take serious effort, so please bear with me... but I think we need the same SvgImage / SvgFactory distinction here. So we need one "Canvas" value object, and one "CanvasOperations" service class, which can take a canvas object as input and apply its transformations. This will prevent fluent API of course, but I think it will be much more beneficial in the future, better testable, and also better for LLM Agents to work with hard architectural decisions that we'll need to enforce across the core. So instead of: ``` $canvas = GraphicsCanvas::create(8, 8, 0, 0, 0); $canvas->fillRect(0, 0, 4, 4, $canvas->allocateColor(255, 0, 0)); $canvas->fillRect(4, 0, 4, 4, $canvas->allocateColor(0, 255, 0)); $canvas->fillRect(0, 4, 4, 4, $canvas->allocateColor(0, 0, 255)); $canvas->fillRect(4, 4, 4, 4, $canvas->allocateColor(255, 255, 255)); ``` let's have this: ``` $canvas = GraphicsCanvasFactory::create(8, 8, 0, 0, 0); $this->graphicsCanvasOperations->fillRect($canvas, 0, 0, 4, 4, $this->graphicsCanvasOperations->allocateColor(255, 0, 0)); $this->graphicsCanvasOperations->fillRect($canvas, 4, 0, 4, 4, $this->graphicsCanvasOperations->allocateColor(0, 255, 0)); $this->graphicsCanvasOperations->fillRect($canvas, 0, 4, 4, 4, $this->graphicsCanvasOperations->allocateColor(0, 0, 255)); $this->graphicsCanvasOperations->fillRect($canvas, 4, 4, 4, 4, $this->graphicsCanvasOperations->allocateColor(255, 255, 255)); ``` or even this: ``` $canvas = GraphicsCanvasFactory::create(8, 8, 0, 0, 0); $operations = [ $this->graphicsCanvasOperationEnum::fillRect => [0, 0, 4, 4, $this->graphicsCanvasOperations->allocateColor(255, 0, 0)), $this->graphicsCanvasOperationEnum::fillRect => [4, 0, 4, 4, $this->graphicsCanvasOperations->allocateColor(0, 255, 0)), $this->graphicsCanvasOperationEnum::fillRect => [0, 4, 4, 4, $this->graphicsCanvasOperations->allocateColor(0, 0, 255)), $this->graphicsCanvasOperationEnum::fillRect => [4, 4, 4, 4, $this->graphicsCanvasOperations->allocateColor(255, 255, 255)), ]; $canvas = $this->graphicsCanvasOperations->apply($canvas, $operations); ``` The result could even be a immutable canvas object then, still with "ease of use" of multiple applications. We could even "outsource" every single operation as a GraphicalCanvas\Operation\rect, GraphicalCanvas\Operation\circle etc. object, make it a tagged iterator, collect every operation dynamically, and then let GDLib or ImageMagick provide each operation on their own. I think only this allows us to refactor it into this in the future, if we now make the right architectural, binding choices.LocalImageProcessor.php:389See other note - I like that we defer this 1990-looking gif. We probably should log an error for this though instead. Definitely a custom/other processor though needs to be able to create previews for non-image files.Deprecation-109578-GifBuilderGetTemporaryImageWithText.rst:6Honestly I think we could keep this method arround, it might be nice for extensions and implementors to have such a "dummy rendering" in place?GraphicalFunctionsController.php:61I think we could extract this as a ArrayUtility helper method.GraphicalFunctionsController.php:127I would extract this into a private method instead for better maintainability/readability.GraphicalFunctionsController.php:173Extract this into a helper method too to prevent a very long running "main" method. Better even, create a "DemoProvider" class that has this scaffodling, to keep the Controller a bit more "sane" to read.GraphicalFunctionsController.php:700Use short domain language notation.GifBuilder.fluid.html:10I love this view!GridDataService.php:806(same question - what does this do to PDF previews and other custom processors?) -
Oliver Hader wrote 06/26/26, 09:47
Removed Code-Review-2 by Christian Kuhn -
Oliver Hader commented on patch set 14 06/26/26, 09:48
Unblocking this patch to proceed in a constructive way, without blocking this initiative by the `-2` that has been given. -
Benjamin Kott rebased onto patch set 15
V +107/21/26, 07:45 -
core-ci voted on patch set 15 V +1 07/21/26, 07:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105077
-
Benjamin Kott uploaded patch set 16
V +107/22/26, 11:15 -
Benjamin Kott commented on patch set 16 07/22/26, 11:18
GraphicalFunctionsController.php:61ReplyDoneGraphicalFunctionsController.php:127ReplyDoneGraphicalFunctionsController.php:173ReplyDoneGraphicalFunctionsController.php:700ReplyDone -
Benjamin Kott commented on patch set 16 07/22/26, 11:21
ThumbnailViewHelper.php:102Replyis image runs against, gfx image config, that currently needs to hold pdf to be processed, added tests -
core-ci voted on patch set 16 V +1 07/22/26, 11:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105161
-
Benjamin Kott commented on patch set 16 07/22/26, 12:16
Reply
Scrolling is fixed with: https://review.typo3.org/c/Packages/TYPO3.CMS/+/94848Reply
Done -
Benjamin Kott commented on patch set 16 07/22/26, 12:26
LocalImageProcessor.php:389ReplyDone -
Benjamin Kott commented on patch set 16 07/22/26, 12:28
GridDataService.php:806Replypdfs need to be marked as image to be processed we only exclude other files -
Garvin Hicking commented on patch set 16 07/22/26, 12:31
Deprecation-109578-GifBuilderGetTemporaryImageWithText.rst:6ReplyTalked to Benji about this. The new API already will make it easier to integrate this properly. No need to carry the legacy weight around then, which will forever be bound the the 1990s gif. Resolving. -
Garvin Hicking commented on patch set 16 07/22/26, 12:35
GraphicsCanvas.php:38ReplyI won't find time for this to implement myself in the foreseeable time, and also don't want to implement something that no one else is supporting. However, personally I can't vote on the "working model" approach, but I won't be blocking anyone who feels to go with the current approach. I'll leave it unresolved for the positive voters to resolve. I'd be happy for anyone pushing this patch forward in either direction, if they feel this is an architectural sound way for the future and can maintain the concept. Thanks for the work already in this patch, and any further finishing touches on it! 😊
-
Andreas Kienast commented on patch set 16 07/23/26, 15:01
GifBuilder.php:2330Interesting, this file doesn't exist. -
Andreas Kienast commented on patch set 16 CR -1 07/24/26, 05:48
Needs a rebase after https://review.typo3.org/c/Packages/TYPO3.CMS/+/94909 went in. Also, the ReST has to be moved and the deprecations need adjustments (v15 -> v16).GifBuilder.php:2330ReplyNever mind, my IDE trolled me... -
Andreas Kienast uploaded patch set 17
CR -1V +107/24/26, 07:21 -
core-ci voted on patch set 17 V -1 07/24/26, 07:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105295
-
Andreas Kienast uploaded patch set 18
V -107/24/26, 14:07 -
Andreas Kienast commented on patch set 18 07/24/26, 14:08
GraphicsCanvas.php:76`canRead()` and `canWrite()` should perhaps also check whether `isAvailable()` is true. wdyt? -
core-ci voted on patch set 18 V +1 07/24/26, 14:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105321
-
Benni Mack commented on patch set 18 07/24/26, 14:33
this patch covers a lot of changes, I'd rather split this up. First, I recommends building a capabiliites / "supported" class (service). Then, the "generateTemporaryImage" could a separate change, even a bugfix to actually render a shipped SVG "Could not generate preview image" so we do not need to generate another temp image again. This would then reduce this code making a review easier to grasp. -
Benni Mack uploaded patch set 19
V +107/25/26, 14:15 -
Benni Mack commented on patch set 19 07/25/26, 14:17
Reply
I updated this patchGraphicsCanvas.php:38Reply@garvin@hick.ing please see the changes now, I made the GraphicsCanvas immutable and also extracted some capabilities, which we're gonna touch in followup patches now again.GraphicsCanvas.php:76ReplyDone -
core-ci voted on patch set 19 V +1 07/25/26, 14:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105394
-
Benjamin Kott uploaded patch set 20
V +108/25/26, 12:50 -
Benjamin Kott commented on patch set 20 08/25/26, 12:53
GraphicsCanvas.php:38Replyas discussed with benni, revoked bennis changes, and improved the gd detection -
core-ci voted on patch set 20 V +1 08/25/26, 12:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107089
-
Georg Ringer voted on patch set 20 CR +1 V +1 08/25/26, 13:42
-
Georg Ringer uploaded patch set 21 08/25/26, 14:29
Copied Votes: * Code-Review+1 (copy condition: "**changekind:NO_CHANGE** OR is:MIN") * Verified+1 (copy condition: "**changekind:NO_CHANGE**") -
core-ci voted on patch set 21 V +1 08/25/26, 14:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107091
-
Andreas Kienast commented on patch set 21 CR -1 08/26/26, 05:59
GraphicsCanvas.php:182Excerpt from https://www.php.net/manual/en/function.imagesavealpha.php: > Note: > > **imagesavealpha()** is only meaningful for PNG images, since the full alpha channel is always saved for WebP and AVIF. It is not recommended to rely on this behavior, as it may change in the future. Thus, **imagesavealpha()** should be called deliberately also for WebP and AVIF images.GraphicsCanvas.php:244This method is unused, but single calls to `imagesavealpha()` and `imagealphablending()` are spread in this class.GraphicalFunctionsController.php:46We can finally use typed constants (`private const string ...`) -
Benjamin Kott uploaded patch set 22
CR +1V +108/26/26, 07:11 -
Benjamin Kott commented on patch set 22 08/26/26, 07:11
GraphicsCanvas.php:182ReplyDoneGraphicsCanvas.php:244ReplyDoneGraphicalFunctionsController.php:46ReplyDone -
core-ci voted on patch set 22 V +1 08/26/26, 07:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107119
-
Andreas Kienast voted on patch set 22 CR +1 V +1 08/26/26, 07:25
-
Georg Ringer voted on patch set 22 CR +1 V +1 08/26/26, 08:10
-
Benjamin Kott voted on patch set 22 CR +2 V +2 08/26/26, 08:18
-
Benjamin Kott merged patch set 23 08/26/26, 08:18