Skip to content

Commit

Permalink
FIX: benjaminkott#1075 Image multiplier loop in ImageVariantsUtility.php
Browse files Browse the repository at this point in the history
Loop over variants and apply the right multiplier instead of looping over variants.
  • Loading branch information
jonasesr authored Apr 13, 2022
1 parent 7ac32df commit 5e6dbd4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Classes/Utility/ImageVariantsUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ protected static function removeGutters(array $variants, array $gutters): array
*/
protected static function processMultiplier(array $variants, array $multiplier): array
{
foreach ($multiplier as $variant => $value) {
if (is_numeric($value) && $value > 0 && isset($variants[$variant]['width'])) {
$variants[$variant]['width'] = (int) ceil($variants[$variant]['width'] * (float) $value);
foreach ($variants as $key => $variant) {
if (isset($variant['width'])) {
$variants[$key]['width'] = (int) ceil($variant['width'] * (float) ($multiplier[$key] ?? $multiplier['default'] ?? 1));
}
}
return $variants;
Expand Down

0 comments on commit 5e6dbd4

Please sign in to comment.