Skip to content

Commit

Permalink
Fixed format transform param
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed May 13, 2022
1 parent 41d2806 commit 32b0573
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes for Craft CMS 4

## Unreleased

### Fixed
- Fixed a bug where dynamically-defined image transforms weren’t respecting the `format` param, unless the `generateTransformsBeforePageLoad` config setting was enabled.

## 4.0.2 - 2022-05-11

### Changed
Expand Down
4 changes: 4 additions & 0 deletions src/models/ImageTransformIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ public function getTransform(): ImageTransform
throw new InvalidConfigException('Invalid transform string: ' . $this->transformString);
}

if ($this->format) {
$this->_transform->format = $this->format;
}

return $this->_transform;
}

Expand Down

0 comments on commit 32b0573

Please sign in to comment.