Skip to content

Commit

Permalink
Merge branch 'release/1.6.1' into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Aug 13, 2019
2 parents a39fa9c + 9a2689a commit 93d8dc7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ImageOptimize Changelog

## 1.6.1 - 2019.08.13
### Changed
* Added more robust sanity checking if an invalid URL or path is being passed into `ImageTransform::appendExtension()`

## 1.6.0 - 2019.07.05
### Added
* Added support for Sharp via [AWS Serverless Image Handler](https://aws.amazon.com/solutions/serverless-image-handler/) as a Transform Method
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ If you wish to dynamically create Optimized Image Variants in your templates wit
To create Optimized Image Variants dynamically in your templates, you can do:

```
{% set optimzedImages = craft.imageOptimize.createOptimizedImages(
{% set optimizedImages = craft.imageOptimize.createOptimizedImages(
someAsset,
[
{
Expand All @@ -220,7 +220,7 @@ To create Optimized Image Variants dynamically in your templates, you can do:
All of these fields are required, and they are analogous to the settings provided by the Field. The `retinaSizes` is an array of multipliers for the retina variants. For instance, if we wanted both normal resolution and 2x variants of the above image, we'd do:

```
{% set optimzedImages = craft.imageOptimize.createOptimizedImages(
{% set optimizedImages = craft.imageOptimize.createOptimizedImages(
someAsset,
[
{
Expand All @@ -240,7 +240,7 @@ All of these fields are required, and they are analogous to the settings provide
You can create as many Optimized Image Variants as you like, by just including another array of settings. For example, to create both 200x and 400x image variants, we could do:

```
{% set optimzedImages = craft.imageOptimize.createOptimizedImages(
{% set optimizedImages = craft.imageOptimize.createOptimizedImages(
someAsset,
[
{
Expand Down Expand Up @@ -271,7 +271,7 @@ The `optimizedImages` object that is returned to you can be used in your templat
**N.B.:** Because they are lengthy operations, by default the generation of the dominant color palette and the generation of the placeholder silhouette are off. You can enable them via an additional parameter passed down to `craft.imageOptimize.createOptimizedImages`:

```
{% set optimzedImages = craft.imageOptimize.createOptimizedImages(
{% set optimizedImages = craft.imageOptimize.createOptimizedImages(
someAsset,
[
{
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "1.6.0",
"version": "1.6.1",
"keywords": [
"craft",
"cms",
Expand Down
2 changes: 1 addition & 1 deletion src/imagetransforms/ImageTransform.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function appendExtension($pathOrUrl, $extension): string
{
$path = $this->decomposeUrl($pathOrUrl);
$path_parts = pathinfo($path['path']);
$new_path = $path_parts['filename'] . '.' . $path_parts['extension'] . $extension;
$new_path = ($path_parts['filename'] ?? '') . '.' . ($path_parts['extension'] ?? '') . $extension;
if (!empty($path_parts['dirname']) && $path_parts['dirname'] !== '.') {
$new_path = $path_parts['dirname'] . DIRECTORY_SEPARATOR . $new_path;
$new_path = preg_replace('/([^:])(\/{2,})/', '$1/', $new_path);
Expand Down

0 comments on commit 93d8dc7

Please sign in to comment.