Issue Bug Closed

#93679Cropping to 0 (zero) pixels height/width breaks page/content editing

Mathias Brodala 03/08/21, 14:49 updated 09/20/23, 14:36

Description

It is possible to store an image cropping configuration of 0 (zero) pixels in width or height. For this an editor simply needs to reduce the cropping frame to 0 in width or height. After saving an error shows up:

> Width and height of the image must be greater than zero

(See https://github.com/TYPO3/TYPO3.CMS/blob/10.4/typo3/sysext/core/Classes/Imaging/ImageDimension.php#L76)

Unless the crop field of the affected sys_file_reference record is cleared/fixed manually in the database, viewing the page in the Page module or editing the affected record in the List module is impossible due to this error.

A few options to fix this:

  1. Require a minimum of 1×1 Pixel for cropping
  2. Display error and disable Accept in the Image manipulation wizard
  3. Handle a width/height of 0 Pixel more gratuitously in ImageDimension.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.