I think there is an issue with commit 3862ee3.

That patch replaced line 1578 in the theme_image_srcset() function with this:
$key = (int) ((float) drupal_substr($src['multiplier'], -1) * 100);

Which always equals zero (0) when run on a multipler like '1x', '2x', or '3x' because the drupal_substr() function always outputs the last character: 'x'. So the $srcsets array always overwrites itself at key zero.

I'm not really sure why the code was changed from what was there before which seems like the safest approach since it doesn't clash with the width key on line 1574:
$key = $src['multiplier'];

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Daniel Korte created an issue. See original summary.

Daniel Korte’s picture

Attached patch reverts commit 3862ee3 at line 1578.

attiks’s picture

FileSize
595 bytes

New patch, we need the float to handle the 1.5x

  • attiks committed 6fea55f on 7.x-2.x
    Issue #2614378 by Daniel Korte, attiks: theme_image_srcset() multiplier...
attiks’s picture

Status: Needs review » Fixed

Committed to dev, thanks

Status: Fixed » Closed (fixed)

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