- Issue created by @robphillips
- last update
over 1 year ago 8,613 pass - @robphillips opened merge request.
- Status changed to Needs review
over 1 year ago 1:45pm 28 April 2023 - 🇺🇸United States robphillips
Patch from MR. If either width or height is not a positive number do not return a style name.
https://git.drupalcode.org/project/image_effects/-/merge_requests/32/dif...
- Status changed to Needs work
over 1 year ago 6:33pm 28 April 2023 - 🇮🇹Italy mondrake 🇮🇹
Thanks.
1) instead of returning in getChildImageStyleToExecute, I'd rather avoid to call it in applyEffect and transformDimensions when the image is invalid.
2) an automated test would help prevent regressions. - 🇭🇷Croatia Aporie
There is a duplicated issue #3136292: Division by zero in AspectSwitcherImageEffect → which patch caused us
Error: Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '256' frames in is_int() (line 331 of core/lib/Drupal/Component/Utility/NestedArray.php).
This patch is fine though (and seems an easier approach) than the attached duplicated issue.
- 🇦🇹Austria mvonfrie
MR !32 works, but this is only half of the truth. In my case the image was not corrupted but the thumbnail of a document media entity embedded in a body field via CKeditor.
Steps to reproduce
- Create an image style with at least one aspect switcher effect.
- Enable Drupal Media with the Document media type including thumbnails.
- Configure a text format using CKeditor5 to allow adding Drupal media documents.
- Configure media documents default view mode to include the thumbnail image using the image style created before.
- Upload a document via Drupal media and ensure it has a valid, non-corrupted thumbnail image.
- Edit the body of any content using the configured text format, add the uploaded document via the Drupal Media button.
- Observe an error message in the CKeditor preview.
- Save and attempt to view the content with the included document.