Review main Abandoned

90428[TASK] LocalCropScaleMaskHelper can optionally always create images

C. Gogolin CR 0 V -1 Hard +217 −90 updated 11/11/26, 13:37

Commit message

Adjusting the LocalCropScaleMaskHelper class ensures the helper
always produces images. This is useful when you want to create
a custom image-processing task, retain the LocalImageProcessor’s
standard functionality, but always require images for further
processing.

In addition to the option to force the helper to always generate
images, the ability to execute processors in a chain has been added.
This allows pre-processors to force image generation and a
post-processor to perform touch-ups at the end.

Each processor can decide whether there may be another processor
after it. Existing processor implementations do not explicitly
indicate that someone may follow them. Thus the chain is immediately
terminated after them, preserving the previous behavior.

Review

  • Code review CR 0
  • Verified V -1
    • core-ci -1 CI

Issues 1

Files 11

Review log 68108

Show 5183 earlier messages
  1. C. Gogolin uploaded patch set 1 08/17/25, 15:58

  2. core-ci voted on patch set 1 V -1 08/17/25, 16:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83534

  3. Garvin Hicking commented on patch set 1 08/17/25, 16:54

    LocalCropScaleMaskHelper.php:29

    Introducing a constructor with "scalar" parameters here will block dependency injection and we should prevent this. Introducing "state" to this object (like a $this->forceCreation) and using a set/get method would also negatively impact the architecture of this class. I have not yet dug into this but I wonder if we could carry this option inside the $task object, specifically the "getProcessingConfiguration". Did you maybe have a look if that could be feasible?
  4. C. Gogolin rebased onto patch set 2 V -1 08/19/25, 10:07

  5. core-ci voted on patch set 2 V -1 08/19/25, 10:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83604

  6. Simon Schaufelberger commented on patch set 2 CR -1 08/19/25, 10:19

    Please use your full name and why do you use a spam email address here?
  7. C. Gogolin commented on patch set 2 08/19/25, 10:42

    Unresolved

    If the helper should remain stateless, that’s fine—I understand. As I see it, getProcessingConfiguration() belongs to the TargetFile (ProcessedFile), not the task, and the task’s configurations can’t be used either, because they serve as database keys for image properties. So $forceCreation doesn’t belong there. What do you think about creating an abstract LocalCropScaleMaskHelper and deriving two helpers from it—one with $forceCreation and one without? Alternatively, we could introduce a marker interface for handling the TaskInterface. If a task implements that marker, forceCreation would be activated. In my extension, I’d then wrap the original TaskInterface implementation with TaskInterface + Marker to sneak in the forceCreate flag. Or, more bluntly, we could extend the TaskInterface itself… Is it possible in PHP to apply traits to interfaces to achieve something like Java’s default methods?

    Reply

    I have completed my name. My email address is like this for historical reasons. I haven't had any reason to change it yet. If I want to contribute to the typo3 project in the future, I can change it again.

    LocalCropScaleMaskHelper.php:29 Reply Unresolved

    If the helper should remain stateless, that’s fine—I understand. As I see it, getProcessingConfiguration() belongs to the TargetFile (ProcessedFile), not the task, and the task’s configurations can’t be used either, because they serve as database keys for image properties. So $forceCreation doesn’t belong there. What do you think about creating an abstract LocalCropScaleMaskHelper and deriving two helpers from it—one with $forceCreation and one without? Alternatively, we could introduce a marker interface for handling the TaskInterface. If a task implements that marker, forceCreation would be activated. In my extension, I’d then wrap the original TaskInterface implementation with TaskInterface + Marker to sneak in the forceCreate flag. Or, more bluntly, we could extend the TaskInterface itself… Is it possible in PHP to apply traits to interfaces to achieve something like Java’s default methods?
  8. C. Gogolin commented on patch set 2 08/19/25, 10:43

    I have completed my name. My email address is like this for historical reasons. I haven't had any reason to change it yet. If I want to contribute to the typo3 project in the future, I can change it again.
  9. Oli Bartsch commented on patch set 2 08/19/25, 10:57

    Reply

    Hi Clemens! Thank you very much for your first contribution! And, IMO your email does not matter here at all, since we know each other by name now :)
  10. Simon Schaufelberger voted on patch set 2 CR 0 08/19/25, 12:33

  11. C. Gogolin rebased onto patch set 3 V -1 08/19/25, 15:24

  12. core-ci voted on patch set 3 V -1 08/19/25, 15:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83615

  13. Garvin Hicking commented on patch set 3 08/19/25, 20:08

    (pinged benni about this. Maybe we should either introduce a PSR-14 event dispatch to LocalImageProcessor to execute further processing. Or make the processsor registry allow stackable processors, so they can take effect affer LocalImageProcessor is done)
  14. Garvin Hicking commented on patch set 3 08/19/25, 20:08

    Reply Unresolved

    (unresolving)
  15. C. Gogolin uploaded patch set 4 V -1 08/20/25, 06:54

  16. C. Gogolin uploaded patch set 5 08/20/25, 06:56

  17. core-ci voted on patch set 4 V -1 08/20/25, 07:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83657

  18. core-ci voted on patch set 5 V -1 08/20/25, 07:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83658

  19. C. Gogolin uploaded patch set 6 V -1 08/20/25, 07:06

  20. core-ci voted on patch set 6 V -1 08/20/25, 07:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83659

  21. C. Gogolin uploaded patch set 7 V -1 08/20/25, 07:26

  22. core-ci voted on patch set 7 V -1 08/20/25, 07:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83660

  23. C. Gogolin uploaded patch set 8 V -1 08/20/25, 07:50

  24. core-ci voted on patch set 8 V +1 08/20/25, 07:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83662

  25. Oliver Klee updated the commit message in patch set 9 V +1 08/20/25, 08:17

  26. core-ci voted on patch set 9 V +1 08/20/25, 08:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83664

  27. Simon Schaufelberger wrote 08/20/25, 09:46

    Removed reviewer Simon Schaufelberger.
  28. Stefan Froemken updated the commit message in patch set 10 V +1 08/22/25, 08:18

  29. core-ci voted on patch set 10 V +1 08/22/25, 08:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83746

  30. Stefan Froemken commented on patch set 10 CR -1 08/22/25, 08:28

    LocalCropScaleMaskHelper.php:54

    You're adding a boolean value to a string here
  31. Garvin Hicking commented on patch set 10 08/22/25, 08:28

    Unresolved

    alternate approach: 90462: [POC][TASK] Make LocalCropScaleMaskHelper aware of "forceCreation" | https://review.typo3.org/c/Packages/TYPO3.CMS/+/90462
  32. C. Gogolin commented on patch set 10 08/22/25, 19:33

    Embarrassing, embarrassing - thank you for your watchful eye.

    LocalCropScaleMaskHelper.php:54 Reply

    Embarrassing, embarrassing - thank you for your watchful eye.
  33. C. Gogolin uploaded patch set 11 CR -1 V +1 08/22/25, 19:34

  34. core-ci voted on patch set 11 V -1 08/22/25, 19:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83777

  35. C. Gogolin uploaded patch set 12 V -1 08/23/25, 11:16

  36. core-ci voted on patch set 12 V +1 08/23/25, 11:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83794

  37. C. Gogolin uploaded patch set 13 V +1 08/23/25, 15:05

  38. C. Gogolin uploaded patch set 14 08/23/25, 15:12

  39. core-ci voted on patch set 13 V -1 08/23/25, 15:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83797

  40. C. Gogolin uploaded patch set 15 08/23/25, 15:15

  41. core-ci voted on patch set 14 V -1 08/23/25, 15:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83798

  42. core-ci voted on patch set 15 V -1 08/23/25, 15:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83799

  43. C. Gogolin uploaded patch set 16 V -1 08/23/25, 15:32

  44. core-ci voted on patch set 16 V -1 08/23/25, 15:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83800

  45. C. Gogolin uploaded patch set 17 V -1 08/23/25, 15:47

  46. core-ci voted on patch set 17 V +1 08/23/25, 15:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83801

  47. C. Gogolin uploaded patch set 18 V +1 08/24/25, 19:30

  48. C. Gogolin uploaded patch set 19 08/24/25, 19:30

  49. core-ci voted on patch set 18 V -1 08/24/25, 19:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83822

  50. core-ci voted on patch set 19 V -1 08/24/25, 19:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83823

  51. Garvin Hicking commented on patch set 19 08/25/25, 06:18

    BeforeFileProcessingEvent.php:32

    There's a typo here, and also you could use "constructor property promotion" to gather this property in the constructor like the others (non-readonly of course)?
  52. C. Gogolin uploaded patch set 20 V -1 08/29/25, 19:12

  53. C. Gogolin commented on patch set 20 08/29/25, 19:13

    BeforeFileProcessingEvent.php:32 Reply Unresolved

    Is changed. Thanks for your hint.
  54. core-ci voted on patch set 20 V -1 08/29/25, 19:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84015

  55. C. Gogolin uploaded patch set 21 V -1 08/31/25, 14:21

  56. core-ci voted on patch set 21 V -1 08/31/25, 14:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84093

  57. C. Gogolin uploaded patch set 22 V -1 08/31/25, 15:21

  58. core-ci voted on patch set 22 V -1 08/31/25, 15:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84094

  59. C. Gogolin uploaded patch set 23 V -1 08/31/25, 15:32

  60. core-ci voted on patch set 23 V -1 08/31/25, 15:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84095

  61. C. Gogolin uploaded patch set 24 V -1 08/31/25, 15:46

  62. core-ci voted on patch set 24 V -1 08/31/25, 15:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84096

  63. C. Gogolin uploaded patch set 25 V -1 08/31/25, 18:28

  64. core-ci voted on patch set 25 V +1 08/31/25, 18:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84098

  65. C. Gogolin rebased onto patch set 26 V +1 08/31/25, 18:57

  66. C. Gogolin uploaded patch set 27 08/31/25, 18:59

  67. core-ci voted on patch set 26 V +1 08/31/25, 19:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84099

  68. core-ci voted on patch set 27 V +1 08/31/25, 19:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84100

  69. Garvin Hicking commented on patch set 27 CR -1 09/06/25, 11:05

    Review-Note: Let's wait for https://review.typo3.org/c/Packages/TYPO3.CMS/+/90549 https://review.typo3.org/c/Packages/TYPO3.CMS/+/90532 and then iterate on this here. I think we're getting somewhere, and the "stackable processors" could be worked into it.
  70. C. Gogolin uploaded patch set 28 CR -1 V +1 09/14/25, 14:55

  71. C. Gogolin wrote 09/14/25, 15:00

    Removed cc Elias Häußler.
  72. core-ci voted on patch set 28 V +1 09/14/25, 15:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84959

  73. C. Gogolin rebased onto patch set 29 V +1 09/14/25, 15:37

  74. core-ci voted on patch set 29 V +1 09/14/25, 15:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84960

  75. C. Gogolin rebased onto patch set 30 V +1 09/21/25, 06:54

    The following files contain Git conflicts: * typo3/sysext/core/Classes/Resource/Service/FileProcessingService.php
  76. core-ci voted on patch set 30 V -1 09/21/25, 07:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85240

  77. Elias Häußler commented on patch set 31 09/21/25, 11:13

    Published edit on patch set 30. Copied Votes: * Verified-1 (copy condition: "**changekind:NO_CHANGE**")
  78. core-ci voted on patch set 31 V -1 09/21/25, 11:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85244

  79. C. Gogolin uploaded patch set 32 V -1 09/21/25, 15:07

  80. core-ci voted on patch set 32 V -1 09/21/25, 15:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85248

  81. Christian Reifenscheid commented on patch set 32 09/21/25, 16:21

    I don't know, why I was set cc. Therefor I removed myself. Have a pleasant Sunday. :-)
  82. C. Gogolin uploaded patch set 33 V -1 09/21/25, 16:55

  83. C. Gogolin uploaded patch set 34 09/21/25, 16:56

  1. C. Gogolin commented on patch set 33 09/21/25, 16:57

    This change is ready for review.

    Reply

    Sorry, my mistake. I don't get along well with your one-commit-no-branches strategy. It wasn't intentional. Have a great start to the week...
  2. C. Gogolin marked it ready for review 09/21/25, 16:57

  3. C. Gogolin marked it work in progress 09/21/25, 17:03

  4. core-ci voted on patch set 34 V -1 09/21/25, 17:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85252

  5. core-ci voted on patch set 33 V -1 09/21/25, 17:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85251

  6. C. Gogolin uploaded patch set 35 V -1 09/21/25, 17:11

  7. core-ci voted on patch set 35 V -1 09/21/25, 17:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85253

  8. C. Gogolin uploaded patch set 36 V -1 09/21/25, 17:24

  9. core-ci voted on patch set 36 V -1 09/21/25, 17:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85254

  10. Christian Reifenscheid wrote 09/21/25, 17:47

    Removed cc Christian Reifenscheid.
  11. Garvin Hicking commented on patch set 36 09/21/25, 18:53

    I'm very happy for your effort - without having really looked into the "best approach" here, I have some notes. I'd be very happy if we can get @benni@typo3.org to chime in, if this approach fits into the architectural changes he made. (We'll definitely need to change this patch to `[FEATURE]` now)

    LocalImageProcessor.php:51

    I think we could keep `void` here?

    LocalImageProcessor.php:212

    ```suggestion $forceCreation, ```

    LocalImageProcessor.php:227

    ```suggestion $forceCreation, ```

    ProcessorRegistry.php:44

    Removing this method would be a breaking change that we need to document. Since it's a public method, and the class is not internal, we would first need to deprecate it and only remove it in v15. Maybe we could better just introduce the getOrdneredProcessers() method here and let the old method stand? (Have not looked to deep into that yet!)

    ProcessorRegistry.php:46

    A return type hint could set this as `ProcessorInterface[]` here

    TaskInterface.php:120

    We would also need to document this breaking change due to new methods that would need implementation. If we already introduce the ProcessorTrait I'm thinking if we might want to add stub methods for this inside the trait? While touching on that, I'm not 100% sure about this "transitional data" plain array. Maybe we should use some typed kind of DTO / state object (ObjectStorage) instead. Having a very broad "data storage" here might be tempting to put all sorts of things into there? Then we would not have getters and setters inside the implementing class itself, but only on the data object that is injected, and maybe even passed via DI? (Again: I have not deeply looked into this yet, just trying to make mental notes)

    FileProcessingService.php:76

    (See note on return type hint of getOrderedProcessors, then this direct type hint would not be needed)

    ProcessorRegistryTest.php:43 Unresolved

    We could need a new test that shows how stacked processors would influence each others / could actually stack
  12. C. Gogolin uploaded patch set 37 V -1 09/22/25, 17:38

  13. core-ci voted on patch set 37 V -1 09/22/25, 17:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85328

  14. C. Gogolin uploaded patch set 38 V -1 09/22/25, 18:01

  15. core-ci voted on patch set 38 V -1 09/22/25, 18:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85331

  16. Christian Reifenscheid wrote 09/22/25, 18:09

    Removed cc Christian Reifenscheid.
  17. C. Gogolin rebased onto patch set 39 V -1 09/22/25, 18:18

  18. core-ci voted on patch set 39 V -1 09/22/25, 18:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85332

  19. Garvin Hicking commented on patch set 39 09/22/25, 18:47

    Reply Unresolved

    unresolving
  20. C. Gogolin commented on patch set 39 09/23/25, 20:07

    LocalImageProcessor.php:51 Reply Unresolved

    Added. Wouldn't it make sense in this case to add :void to ProcessorInterface#processTask(TaskInterface task)? And while we're at it: ProcessorInterface#canProcessTask(TaskInterface task) with :bool?

    LocalImageProcessor.php:212 Reply

    Do you do it that way? Even if 'forceCreation' is the last parameter?

    LocalImageProcessor.php:227 Reply

    Do you do it that way? Even if 'forceCreation' is the last parameter?

    ProcessorRegistry.php:44 Reply Unresolved

    We can keep the method if you like—what's the equivalent of @Deprecated in the PHP world? And nobody calls this method anymore... ?

    ProcessorRegistry.php:46 Reply

    Does that need to go in the method comment? :ProcessorInterface[] after the method is highlighted in red in my IDE?!

    TaskInterface.php:120 Reply Unresolved

    You'll need to help me with that... I built it without an array. What do you think? My new idea: The processor provides a transitional data container containing parameters it can process.

    FileProcessingService.php:76 Reply

    Acknowledged
  21. C. Gogolin uploaded patch set 40 V -1 09/25/25, 19:34

  22. core-ci voted on patch set 40 V -1 09/25/25, 19:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85547

  23. Benni Mack abandoned the change 10/29/25, 14:32

  24. Benni Mack restored the change 11/03/25, 06:24

  25. Garvin Hicking abandoned the change 11/11/26, 13:37

    Abandoning, I'm afraid we couldn't move this forward. Can be restored if work shall be put up again.