Skip to content

Commit

Permalink
Fix srcset width filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker authored Dec 29, 2024
1 parent ef22376 commit df0c2c8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/models/OptimizedImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,7 @@ protected function getSrcsetSubsetArray(array $set, int $width, string $comparis
if (empty($this->variantSourceWidths)) {
return $subset;
}
// Sort the arrays by numeric key
ksort($set, SORT_NUMERIC);
// Sort the source widths by numeric key
sort($this->variantSourceWidths, SORT_NUMERIC);
foreach ($this->variantSourceWidths as $variantSourceWidth) {
$match = false;
Expand Down

0 comments on commit df0c2c8

Please sign in to comment.