ImageMagick does not properly convert animated pngs

Created on 31 December 2024, about 2 months ago

Problem/Motivation

ImageMagick 7 supports conversion of animated pngs however this module currently does not convert them to maintain their animation. The code that does the conversion (ImagemagickToolkit::parseFile() line 731-ish) only recognizes the first frame of a multi-frame png animation, whereas gif images do get their actual frame count returned.

Steps to reproduce

1. Install Imagemagick 7 along with drupal 10.3 and imagemagick module 4.0.2.
2. Create an image style and apply it to an image field.
3. Upload an animated png file. The source file has its animation but as soon as an image style is generated, only the first frame is kept.
Note that in the file listed above on that line the frame count returned for an animated png is 1 and should be something else.

Proposed resolution

Support for animated pngs when converting them for image styles. The converted image should be animated like gif images are.

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States peachez

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024