Closed devkev16 closed 4 years ago
I think I don’t fully understand that.
Resizing images for example to 100 by 100 in mode proportional
would mean that landscape images get resized to 100 pixel width and portrait images to 100 pixel height. isEmpty()
must not return true in this case because an actual resize of the image is necessary.
Can you give an example of how your code that does the resize looks like?
@devkev16 feel free to reopen this issue if you have further details.
The ResizeConfiguration has a method where it checks whether an resize is unnecessary. Theres a missing check whether the height and width on the image are already equal when the resize mode is "proportional".
One good reason to change this behavior is: The image URLs don't change during an upgrade from an older version, this could be bad in perspective of seo (google images rankings).
This function: https://github.com/contao/image/blob/1846080f8fb73b674f77ff779f59c28a018c7447/src/ResizeConfiguration.php#L41-L47
Would need to check it like this: