Skip to content

Commit

Permalink
Merge branch 'release/1.0.11' into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Aug 18, 2023
2 parents e4e8b5f + 2172c08 commit 2b36699
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ImageOptimize Sharp Image Transform Changelog


## 1.0.11 - UNRELEASED
### Fixed
* Fixed an issue with corrupted images throwing an exception ([#6](https://github.com/nystudio107/craft-imageoptimize-sharp/issues/6))

## 1.0.10 - 2022.03.29

### Changed
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-sharp",
"description": "Provides an Sharp image transform type for the ImageOptimize plugin.",
"type": "image-transform",
"version": "1.0.10",
"version": "1.0.11",
"keywords": [
"craftcms",
"sharp",
Expand Down
2 changes: 1 addition & 1 deletion src/imagetransforms/SharpImageTransform.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function getTransformUrl(Asset $asset, $transform)
$mode = $edits['resize']['fit'];
$edits['resize']['fit'] = self::TRANSFORM_MODES[$mode] ?? $mode ?? 'cover';
// Handle auto-sharpening
if ($settings->autoSharpenScaledImages) {
if ($settings->autoSharpenScaledImages && $asset->getWidth() && $asset->getHeight()) {
// See if the image has been scaled >= 50%
$widthScale = (int)((($transform->width ?? $asset->getWidth()) / $asset->getWidth()) * 100);
$heightScale = (int)((($transform->height ?? $asset->getHeight()) / $asset->getHeight()) * 100);
Expand Down

0 comments on commit 2b36699

Please sign in to comment.