Review main Merged

88203[TASK] Improve LogicException error output for failed image generation

Garvin Hicking CR +2 V +2 Easy +9 −1 updated 02/19/25, 11:21

Commit message

In case image processing fails to resolve width/height to non-0
values, an exception is thrown to ask for a bugreport/feedback.

This exception was missing vital information to investigate an issue.

With this patch, the extra information about incoming width/height,
resolved width/height and the array of options and croparea
configuration is revealed.

The output is like:

```
Image processing instructions did not resolve into coherent positive
width and height values. This is a bug. Please report. Extra details:
incomingWidth: 2044, incomingHeight: 852, width: 1000, height: 417,
options: { "width": null, "height": null, "maxWidth": 1000,
"maxHeight": 1000, "crop": null }, cropArea: { "x": 0, "y": 0,
"width": 2044, "height": 852 }
```

(Screenshot in issue; exception messages cannot be formatted.)

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Oli Bartsch +1
    • Georg Ringer +1
    • Markus Klein +1
    • Christian Kuhn +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Oli Bartsch +1
    • Georg Ringer +1
    • Markus Klein +1
    • Himanshu Nitsan +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 1518

  1. Garvin Hicking uploaded patch set 1 02/13/25, 08:59

  2. Garvin Hicking updated the commit message in patch set 2 02/13/25, 09:03

  3. Garvin Hicking commented on patch set 2 02/13/25, 09:04

    @ben@bnf.dev If you have the chance, maybe you can check this out - LogicException was introduced with #103351 and maybe you can tell if this data is what would be needed to pursue bugs further (reported on Slack once via: https://typo3.slack.com/archives/C025BQLFA/p1739430010221999)
  4. Garvin Hicking commented on patch set 3 02/13/25, 09:11

    Published edit on patch set 2.
  5. core-ci voted on patch set 1 V -1 02/13/25, 09:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74105

  6. core-ci voted on patch set 2 V -1 02/13/25, 09:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74106

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

  8. Garvin Hicking commented on patch set 3 02/13/25, 10:09

    Reply

    The answer was that a 1920x10 picture would be resized to a width of 64. Due to the enourmous aspect ratio, the height will be rounded down to 0. I would suggest we create a follow-up patch for this and set width/height to '1' instead of '0' in cases like this, what do you think?
  9. Himanshu Nitsan voted on patch set 3 V +1 02/13/25, 10:14

  10. Garvin Hicking commented on patch set 3 02/13/25, 12:12

    Reply

    Pushed https://review.typo3.org/c/Packages/TYPO3.CMS/+/88206 for an approach to this. IMO it could complement this patch here, as I think the logicException could stay for other cropArea miscalculations?
  11. Simon Schaufelberger voted on patch set 3 CR +1 V +1 02/18/25, 08:52

  12. Markus Klein voted on patch set 3 CR +1 V +1 02/18/25, 10:07

  13. Oli Bartsch voted on patch set 3 CR +1 V +1 02/19/25, 09:03

  14. Georg Ringer voted on patch set 3 CR +2 V +2 02/19/25, 09:07

  15. Georg Ringer voted on patch set 3 CR +1 V +1 02/19/25, 09:07

  16. Christian Kuhn voted on patch set 3 CR +1 02/19/25, 11:09

  17. Garvin Hicking commented on patch set 3 CR +2 V +2 02/19/25, 11:21

    Reply

    Done
  18. Garvin Hicking merged patch set 4 02/19/25, 11:21