Problem/Motivation
In Drupal 10, responsive images have height and width attribute.
#3192234: Apply width and height attributes to allow responsive image tag use loading="lazy"
In order to do that, every image effect that changes the dimensions of an image needs to communicate that change to effects that come after it.
Steps to reproduce
1. create an image style with absurd proportions, like 1:999
2. render the image in drupal 10
The image will look distorted because drupal will add height and width attribute that do not reflect the proportions of your image.
Proposed resolution
The code that calculates the new dimensions needs to be seperated from applyEffect. transformDimensions has to be implemented.
Comments
Comment #3
geaseThanks for pointing this out @loominade, honestly, i haven't seen any distortion, but transformDimensions method should have been implemented, you're absolutely correct. It is now in release 2.0, therefore, I'm closing this ticket