Review main Merged

81428[TASK] Migrate ImageMagick $info array to dedicated object

Benni Mack CR +2 V +2 Hard +253 −116 updated 12/19/23, 09:07

Commit message

This change introduces a few number of non-breaking details
to be used for further (breaking) changes in the
Image Processing chain.

On the very low-level A new object called "ImageProcessingResult"
is now used to have the previously $info array

$info[0] = width of an image
$info[1] = height of an image
$info[2] = file extension
$info[3] = full file path

now consumed in an object that is used throughout the lowlevel
area of GraphicalFunctions, Image Procesing and GifBuilder.

The GraphicalFunctions method receives some smarter
methods (currently internal):

* resize() - similar to imageMagickConvert() but with type hints,
  and returning the new object
* convert() - e.g. just convert a jpeg to png

Next steps in this area:

* cObject->getImageResource() should only return ImageProcessingResult
  (and migrate the hook to a PSR-14 event) - Breaking
* GraphicalFunctions->getImageDimensions() and imageMagickConvert()
  should only return these objects (or null) - Breaking
* ImageProcessingResult->toLegacyArray() should be removed
* Have Local*Helper classes return this object or just the file name or
  an ImageInfo object or get rid of them completely - Breaking
* Move "image types available for the browser" into a service class
  out of GraphicalFunctions

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Oliver Klee +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Oliver Klee +1
    • core-ci +1 CI

Issues 1

Files 7

Review log 2438

Show 713 earlier messages
  1. Benni Mack uploaded patch set 1 10/14/23, 18:15

  2. core-ci voted on patch set 1 V -1 10/14/23, 18:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47761

  3. Benni Mack uploaded patch set 2 V -1 10/14/23, 18:31

  4. core-ci voted on patch set 2 V +1 10/14/23, 18:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47762

  5. Oliver Klee commented on patch set 2 10/15/23, 08:39

    ImageProcessingInstructions.php:90

    `int<0, max>` for both

    ImageProcessingResult.php:38

    `int<0, max>` for both

    ImageProcessingResult.php:53

    `@return int<0, max>`

    ImageProcessingResult.php:58

    `@return int<0, max>`

    ImageProcessingResult.php:73

    `@return array{0: int<0, max>, 1: int<0, max>, 2: string, 3: string}`

    ImageProcessingInstructionsTest.php:287

    `@param int<0, max>` for both (which rightfully might avoid some PHPStan warnings)
  6. Benni Mack uploaded patch set 3 V +1 10/21/23, 19:23

  7. core-ci voted on patch set 3 V -1 10/21/23, 19:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48011

  8. Benni Mack uploaded patch set 4 10/22/23, 09:08

    Copied Votes: * Verified-1 (copy condition: "changekind:NO_CHANGE")
  9. Benni Mack uploaded patch set 5 V -1 10/22/23, 09:16

  10. core-ci voted on patch set 4 V -1 10/22/23, 09:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48023

  11. core-ci voted on patch set 5 V -1 10/22/23, 09:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48024

  12. Benni Mack uploaded patch set 6 V -1 10/22/23, 10:07

  13. core-ci voted on patch set 6 V -1 10/22/23, 10:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48028

  1. Benni Mack uploaded patch set 7 V -1 10/22/23, 16:21

  2. core-ci voted on patch set 7 V +1 10/22/23, 16:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48048

  3. Benni Mack uploaded patch set 8 V +1 10/23/23, 09:54

  4. core-ci voted on patch set 8 V +1 10/23/23, 10:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48079

  5. Benni Mack updated the commit message in patch set 9 V +1 10/24/23, 15:07

  6. core-ci voted on patch set 9 V +1 10/24/23, 15:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48131

  7. Benni Mack uploaded patch set 10 V +1 12/15/23, 22:15

  8. Benni Mack uploaded patch set 11 12/15/23, 22:17

  9. core-ci voted on patch set 10 V +1 12/15/23, 22:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50728

  10. Benni Mack commented on patch set 11 12/15/23, 22:21

    ImageProcessingInstructions.php:90 Reply

    Done

    ImageProcessingResult.php:38 Reply

    Done

    ImageProcessingResult.php:53 Reply

    Done

    ImageProcessingResult.php:58 Reply

    Done

    ImageProcessingResult.php:73 Reply

    Done

    ImageProcessingInstructionsTest.php:287 Reply

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

  12. Oliver Klee voted on patch set 11 V +1 12/15/23, 23:43

  13. Benni Mack rebased onto patch set 12 V +1 12/18/23, 10:50

  14. core-ci voted on patch set 12 V +1 12/18/23, 10:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50768

  15. Oliver Klee voted on patch set 12 V +1 12/18/23, 11:51

  16. Oliver Klee voted on patch set 12 CR +1 12/18/23, 14:30

  17. Oli Bartsch commented on patch set 12 12/18/23, 16:11

    GraphicalFunctions.php:289

    Why not using "web" as default since it's set for NULL anyways.

    ImageProcessingResult.php:27

    It

    ImageProcessingResult.php:99

    I suggest making this more clear by either checking for null or with an instanceof check.
  18. Stefan Bürk updated the commit message in patch set 13 CR +1 V +1 12/19/23, 05:16

  19. core-ci voted on patch set 13 V +1 12/19/23, 05:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50782

  20. Oli Bartsch uploaded patch set 14 V +1 12/19/23, 08:36

  21. Oli Bartsch commented on patch set 14 CR +1 V +1 12/19/23, 08:37

    GraphicalFunctions.php:289 Reply

    Done

    ImageProcessingResult.php:27 Reply

    Done

    ImageProcessingResult.php:99 Reply

    Done
  22. core-ci voted on patch set 14 V +1 12/19/23, 08:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50792

  23. Oliver Klee voted on patch set 14 CR +1 V +1 12/19/23, 08:59

  24. Oli Bartsch voted on patch set 14 CR +2 V +2 12/19/23, 09:07

  25. Oli Bartsch merged patch set 15 12/19/23, 09:07