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

loominade created an issue. See original summary.

  • gease committed 1bdd91c8 on 8.x-1.x
    Issue #3401882 by loominade: implement transformDimensions
    
gease’s picture

Status: Active » Fixed

Thanks 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

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.