diff --git a/CHANGELOG.md b/CHANGELOG.md index 11792640..42e7cb40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # ImageOptimize Changelog +## 4.0.9 - 2024.06.19 +### Fixed +* Fixed an issue where `srcsetMaxWidth()` could return incorrect results ([#407](https://github.com/nystudio107/craft-imageoptimize/issues/407)) +* Fixed an issue where the data-uri for inline SVG styles were incorrect in some browsers because the spaces were not URL-encoded ([#408](https://github.com/nystudio107/craft-imageoptimize/issues/408)) + ## 4.0.8 - 2024.05.09 ### Fixed * Fixed an issue where the `.imgTag()` and `.pictureTag()` would output and invalid `style` attribute for lazy loaded images ([#400](https://github.com/nystudio107/craft-imageoptimize/issues/400)) diff --git a/composer.json b/composer.json index 49b81888..708627af 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "nystudio107/craft-imageoptimize", "description": "Automatically create & optimize responsive image transforms, using either native Craft transforms or a service like imgix, with zero template changes.", "type": "craft-plugin", - "version": "4.0.8", + "version": "4.0.9", "keywords": [ "craft", "cms", diff --git a/src/models/OptimizedImage.php b/src/models/OptimizedImage.php index 9fe89c43..2d269e07 100644 --- a/src/models/OptimizedImage.php +++ b/src/models/OptimizedImage.php @@ -618,6 +618,9 @@ 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($this->variantSourceWidths, SORT_NUMERIC); foreach ($this->variantSourceWidths as $variantSourceWidth) { $match = false; switch ($comparison) { diff --git a/src/services/OptimizedImages.php b/src/services/OptimizedImages.php index 316fbe95..b442cc67 100644 --- a/src/services/OptimizedImages.php +++ b/src/services/OptimizedImages.php @@ -422,8 +422,6 @@ public function encodeOptimizedSVGDataUri(string $uri): string $replacements = [ // remove newlines '/%0A/' => '', - // put spaces back in - '/%20/' => ' ', // put equals signs back in '/%3D/' => '=', // put colons back in