Skip to content

Commit 6a0f96d

Browse files
committed
Merge branch 'release/1.6.9' into v1
2 parents c5603d7 + 3bd5a6c commit 6a0f96d

File tree

5 files changed

+25
-2
lines changed

5 files changed

+25
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# ImageOptimize Changelog
22

3+
## 1.6.9 - 2020.02.06
4+
### Changed
5+
* Properly documented how the data in the `imageTransformTypeSettings` config is stored
6+
7+
### Fixed
8+
* Fixed an issue where an SVG sent in to an image transform handler as a thumbnail request without specifying another format to convert to
9+
310
## 1.6.8 - 2020.01.27
411
### Fixed
512
* Fixed an issue where an SVG sent in to image transform handler without specifying another format to convert to

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nystudio107/craft-imageoptimize",
33
"description": "Automatically create & optimize responsive image transforms, using either native Craft transforms or a service like Imgix, with zero template changes.",
44
"type": "craft-plugin",
5-
"version": "1.6.8",
5+
"version": "1.6.9",
66
"keywords": [
77
"craft",
88
"cms",

docs/docs/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
title: 'Image Optimize Documentation',
33
description: 'Documentation for the Image Optimize plugin',
44
base: '/docs/image-optimize/',
5-
dest: '../../../../sites/nystudio107/web/docs/image-optimize',
5+
dest: '~/webdev/sites/nystudio107/web/docs/image-optimize',
66
themeConfig: {
77
displayAllHeaders: true,
88
sidebar: [

src/config.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@
3232

3333
/**
3434
* @var array Settings for the image transform components
35+
*
36+
* The data is stored in the following format, with the key being the class
37+
* of the image transform method:
38+
*
39+
* 'imageTransformTypeSettings' => [
40+
* ImgixImageTransform::class => [
41+
* 'domain' => 'XXXXX',
42+
* 'apiKey' => 'XXXXX',
43+
* 'securityToken' => 'XXXXX',
44+
* ]
45+
* ],
3546
*/
3647
'imageTransformTypeSettings' => [],
3748

src/services/Optimize.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ public function handleGetAssetThumbUrlEvent(GetAssetThumbUrlEvent $event)
210210
]);
211211
/** @var ImageTransform $transformMethod */
212212
$transformMethod = ImageOptimize::$plugin->transformMethod;
213+
// If the final format is an SVG, don't attempt to transform it
214+
$finalFormat = empty($transform['format']) ? $asset->getExtension() : $transform['format'];
215+
if ($finalFormat === 'svg') {
216+
return null;
217+
}
213218
// Generate an image transform url
214219
if ($transformMethod->hasProperty('generateTransformsBeforePageLoad')) {
215220
$transformMethod->generateTransformsBeforePageLoad = $event->generate;

0 commit comments

Comments
 (0)