Skip to content

cropping vs. autogenerate #830

@kitzberger

Description

@kitzberger

Describe the bug
The FilesProcessor has a problem with cropped images that have a autogenerate configuration that comes with a factor. (In case the original image is not that big).

To Reproduce
Steps to reproduce the behavior:

  1. Have a CE with an 100x100 image, apply a 75x25 cropping to it via the cropping editor in BE
  2. Have a processingConfiguration like processingConfiguration.autogenerate.big.factor = 2
  3. The regular image is 75x25, the big variant is not 150x50, but 75x25 stretched to 100x100.

Expected behavior
Both target images should have same crop area, but different size. Maybe same size, but definitely no stretching!

Suspected problem

Comparing with the dimensions of the uncropped original is not correct for cropped images.

    // multiply width/height by factor,
    // but don't stretch image beyond its original dimensions!
    'width' => min($targetWidth * $factor, $originalWidth),
    'height' => min($targetHeight * $factor, $originalHeight),

Screenshots
Original:

Image

Regular crop:

Image

Stretched crop:

Image

TYPO3 version and TYPO3 Headless version

  • TYPO3 12.4
  • EXT:headless 4.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions