diff --git a/src/models/OptimizedImage.php b/src/models/OptimizedImage.php index 2d269e0..92e4f4e 100644 --- a/src/models/OptimizedImage.php +++ b/src/models/OptimizedImage.php @@ -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;