Review main Merged

88206[BUGFIX] Fix failing image generation for width/height 0 thumbnails

Garvin Hicking CR +2 V +2 Normal +45 −14 updated 02/16/25, 18:38

Commit message

Extreme image dimensions like 1920x10 pixels will yield a height=0
in case a 64x64 thumbnail area shall be created.

In these cases, a width/height of 1 should be enforced.

Even though these generated images will not be very helpful to look
at, they must allow image generation to continue working.

As a drive-by, this also ensures integer
values for width/height specified through $options
and mentions the option array key naming in comments.

Review

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

Issues 4

Files 2

Review log 1218

  1. Garvin Hicking uploaded patch set 1 02/13/25, 12:11

  2. core-ci voted on patch set 1 V +1 02/13/25, 12:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74111

  3. Oliver Klee commented on patch set 1 02/13/25, 12:25

    ImageProcessingInstructions.php:181

    We could shorten all these changes with constructs like these: `$width = max($width, 1);`
  4. Garvin Hicking uploaded patch set 2 V +1 02/13/25, 12:55

  5. Garvin Hicking commented on patch set 2 02/13/25, 12:57

    ImageProcessingInstructions.php:181 Reply

    Nice! I was trying to think of a smaller footprint here but was too unimaginative. Implemented it with max() - I switched the order because this way it's easier for me to see that it will be a minimum of '1'. Also, added tests now to verify the new behavior (which would also fail on the old codebase).
  6. Garvin Hicking commented on patch set 3 02/13/25, 12:58

    Published edit on patch set 2.
  7. Oliver Klee voted on patch set 3 CR +1 V +1 02/13/25, 13:00

  8. core-ci voted on patch set 2 V +1 02/13/25, 13:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74112

  9. core-ci voted on patch set 3 V +1 02/13/25, 13:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74113

  10. Garvin Hicking commented on patch set 4 CR +1 V +1 02/15/25, 10:18

    Published edit on patch set 3.
  11. Garvin Hicking updated the commit message in patch set 5 02/15/25, 10:19

  12. core-ci voted on patch set 4 V -1 02/15/25, 10:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74176

  13. core-ci voted on patch set 5 V -1 02/15/25, 10:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74177

  14. Garvin Hicking uploaded patch set 6 V -1 02/15/25, 12:07

  15. core-ci voted on patch set 6 V +1 02/15/25, 12:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74178

  16. Oliver Klee voted on patch set 6 CR +1 V +1 02/15/25, 13:56

  17. Georg Ringer voted on patch set 6 CR +2 V +2 02/16/25, 18:38

  18. Georg Ringer merged patch set 7 02/16/25, 18:38