Skip to content

Commit

Permalink
Merge pull request #416 from bencroker/patch-1
Browse files Browse the repository at this point in the history
Fix `srcset` width filtering
  • Loading branch information
khalwat authored Jan 14, 2025
2 parents 7235056 + df0c2c8 commit 6a00b33
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 6a00b33

Please sign in to comment.