Bug #93807
closedEdit of content elements with image (width=0) not possible
100%
Description
Hello,
a customer made it to set image dimension in Crop-Editor to 0x0. I have tested it and yes, it's a little bit tricky, but it's really possible to mark an area of 0x0px (see picture).
After saving the content element it is not possible to open Site-Module (for this PID) or open the content element over List-Module. This results in Exception:
Oops, an error occurred! Width and height of the original image must be greater than zero More information regarding this error might be available online.
You will find the exception in sysext/core/Classes/Imaging/ImageDimension.php line 76.
PS: It's really hard to debug this Exception. Maybe you see a possibility to add the File UID and the missing width/height of cropping into Exception message. I have searched and queried various DB tables instead...
PPS: missing space in line above ;-)
Stefan
Files
Updated by Stefan Froemken over 3 years ago
Value from sys_file_reference:
{"default":{"cropArea":{"x":0.78,"y":0.575,"width":0,"height":0},"selectedRatio":"1:1","focusArea":null}}
I have changed that in DB to 64x64 and now I can open the content element.
Updated by Sybille Peters about 2 years ago
@Stefan Thanks for reporting this. Had a similar problem.
Some more info:
- name of the field is sys_file_reference.crop
Mine looks like this:
{"default":{"cropArea":{"x":0,"y":0,"width":0,"height":0},"selectedRatio":"NaN","focusArea":null}}
TYPO3 log:
Fri, 16 Sep 2022 17:16:05 +0200 [CRITICAL] request="59ea49227ba55" component="TYPO3.CMS.Core.Error.ProductionExceptionHandler": Core: Exception handler (WEB: BE) BadMethodCallException, code #1597310560, file /var/www/site/releases/80/public/typo3/sysext/core/Classes/Imaging/ImageDimension.php, line 76: Width and height of the image must be greater than zero - {"mode":"WEB","application_mode":"BE","exception_class":"BadMethodCallException","exception_code":1597310560,"file": "/var/www/site/releases/80/public/typo3/sysext/core/Classes/Imaging/ImageDimension.php", "line":76, "message":"Width and height of the image must be greater than zero", "request_url":"https://mysite/typo3/module/web/layout?token=--AnonymizedToken--&id=86055","exception":null,"context":"BE"}
Message in Backend:
503
Oops, an error occurred!
Width and height of the image must be greater than zero
Updated by Chris W over 1 year ago
- Related to Bug #99943: Limit image cropper minimal size added
Updated by Nikita Hovratov about 1 year ago
- Has duplicate Bug #93679: Cropping to 0 (zero) pixels height/width breaks page/content editing added
Updated by Gerrit Code Review about 1 year ago
- Status changed from Accepted to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81111
Updated by Gerrit Code Review about 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81111
Updated by Gerrit Code Review about 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81111
Updated by Gerrit Code Review about 1 year ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81132
Updated by Gerrit Code Review about 1 year ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81133
Updated by Nikita Hovratov about 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d90c493a0f7b55b4ae269235fc9890509d53d741.