From dd84d3ed2fd91b7853c98b3290f083193d863811 Mon Sep 17 00:00:00 2001 From: Brian Hanson Date: Mon, 12 Sep 2022 12:23:15 -0500 Subject: [PATCH 1/3] Allow animated webp #11889 --- src/image/Raster.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/image/Raster.php b/src/image/Raster.php index e3b2c7fea54..e6b77810d05 100644 --- a/src/image/Raster.php +++ b/src/image/Raster.php @@ -209,6 +209,7 @@ public function crop(int $x1, int $x2, int $y1, int $y2) $gif = $this->_instance->create($newSize); $gif->layers()->remove(0); + $this->_image->layers()->coalesce(); foreach ($this->_image->layers() as $layer) { $croppedLayer = $layer->crop($startingPoint, $newSize); $gif->layers()->add($croppedLayer); @@ -703,6 +704,7 @@ private function _getSaveOptions(int $quality = null, string $extension = null): return ['jpeg_quality' => $quality, 'flatten' => true]; case 'gif': + case 'webp': return ['animated' => $this->_isAnimatedGif]; case 'png': From b1c7e76614b6a020de6ec95436531337c5bea363 Mon Sep 17 00:00:00 2001 From: Brian Hanson Date: Mon, 12 Sep 2022 12:25:26 -0500 Subject: [PATCH 2/3] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d1e7d38d09..8ff5bbfc1a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Fixed a bug where it was possible to save an asset with a focal point outside its cropped area. ([#11875](https://github.com/craftcms/cms/issues/11875)) - Fixed a bug where the Assets index page wasn’t handling failed uploads properly. ([#11866](https://github.com/craftcms/cms/issues/11866)) - Fixed a UI bug where renaming a newly-created volume subfolder didn’t appear to have any effect. +- Fixed an issue where gif files couldn't be transformed to an animated webp file. ([#11889](https://github.com/craftcms/cms/issues/11889)) ## 3.7.53.1 - 2022-08-26 From 8ca004a309e9a00ceb5e7d905e62e1cd405ce109 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Tue, 13 Sep 2022 10:19:47 -0700 Subject: [PATCH 3/3] Release note tweak [ci skip] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 389bb06b127..775425d084a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ - Fixed a bug where the Assets index page wasn’t handling failed uploads properly. ([#11866](https://github.com/craftcms/cms/issues/11866)) - Fixed a UI bug where renaming a newly-created volume subfolder didn’t appear to have any effect. - Fixed a bug where empty URL fields would be marked as changed, even when no change was made to them. ([#11908](https://github.com/craftcms/cms/issues/11908)) -- Fixed an issue where gif files couldn't be transformed to an animated webp file. ([#11889](https://github.com/craftcms/cms/issues/11889)) +- Fixed a bug where transforming an animated GIF into a WebP file would only include the first frame. ([#11889](https://github.com/craftcms/cms/issues/11889)) ## 3.7.53.1 - 2022-08-26