Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After updating from 7.x-1.0 to 7.x-1.1, the "aspect switcher" action no longer works. I'm getting the landscape style regardless of the aspect ratio of the original.
Reverting back to 7.x-1.0 restores the expected functionality.
Comments
Comment #1
fietserwinHmmm, it seems to work fine for me. Can you export the styles involved (using the Image styles admin sub module) and paste the strings here?
Comment #2
John Pitcairn CreditAttribution: John Pitcairn commentedThe plot thickens. What I'm getting is the portrait style, but with incorrect width and height attributes specified in the image tag, as if it were the landscape style. If I manually change the attributes to reflect the natural size of the image in the relevant portrait style directory it looks correct. Styles:
These three styles are provided by a custom module, using hook_image_default_styles().
Comment #3
fietserwinI've updated the code that calculates the aspect switcher dimensions (see #1591198: Incorrect width and height attributes on img tags (due to dimensions calculations ignoring NULL's)). I tested it locally and can see that the dimensions are now correctly passed from the correct sub-style. (And also quite easy: #464092: Aspect Switcher / Subroutine: Need to Flush image style on changes in called style works nicely as well...)
Can you check on your site and reopen if it still fails at your site?