From 70f134b9fe9ce3001eb79a7887612af519d5dac2 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Mon, 17 Jun 2024 13:19:00 -0400 Subject: [PATCH] fix: Sort by value, not by key for `variantSourceWidths` --- src/models/OptimizedImage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/OptimizedImage.php b/src/models/OptimizedImage.php index 642944d..2d269e0 100644 --- a/src/models/OptimizedImage.php +++ b/src/models/OptimizedImage.php @@ -620,7 +620,7 @@ protected function getSrcsetSubsetArray(array $set, int $width, string $comparis } // Sort the arrays by numeric key ksort($set, SORT_NUMERIC); - ksort($this->variantSourceWidths, SORT_NUMERIC); + sort($this->variantSourceWidths, SORT_NUMERIC); foreach ($this->variantSourceWidths as $variantSourceWidth) { $match = false; switch ($comparison) {