craftcms / craftcms/cms

Failure when running image transforms on animated GIFs

Open
#9,589 8 comments 0 reactions 1 assignee View on GitHub

@andris-sevcenko is already working on this.

Since Jul 17, 2021.

bug
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

Description

Hi there! We are having persistent issues when running image transforms on animated GIF files. These transforms all attempt to resize the images.

The issues we've seen most often are:
A) the resize operation fails to complete at all
B) the resize operation completes, but the resulting image is "broken" -> the animation has severe artifacts

Our stack is running on Heroku. What we see in the logs is often:

Jul 16 10:51:42 appname app/web.1 [16-Jul-2021 17:51:42] WARNING: [pool www] child 180, script '/app/web/index.php' (request: "GET /index.php?p=actions/assets/generate-transform&transformId=213") execution timed out (49.358224 sec), terminating

We've been able to confirm that we can resize the animated GIFs using ImageMagick command-line tools with no artifacts present and without any delays using this command:

$ convert input.gif  -resize 800x800 -layers OptimizeFrame output.gif
Steps to reproduce
  1. Upload the attached GIF file
  2. Associate it with some article in such a way that the image transforms are requested when viewing the article
  3. View the article and observe you don't see the image; access your system logs and observe warnings or errors
Additional info
  • Craft version: Craft Pro 3.6.17
  • Image driver: Imagick 3.5.0 (ImageMagick 6.9.10-23)
  • PHP version: 7.4.21 running on Linux 4.4.0-1093-aws in Heroku
  • Database driver & version: PostgreSQL 9.5+
  • Plugins & versions:
Amazon S3 		1.2.11
Control Panel CSS 	2.3.0
Feed Me 		4.3.6
Neo 			2.10.7
Redactor 		2.8.7
Sentry SDK 		1.1.2
SEOmatic 		3.3.44
Sprig 			1.7.0
Super Table 		2.6.8
Tags 			1.0.7
Twigpack 		1.2.15
Typed link field 	1.0.25

We've noticed similar issues that are now closed such as this one.

Please let me know if I can supply any additional information to clarify the issue. Thanks.

ocean-waves

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.