For animated gif's we need the -coalesce opperator on resize.

This patch looks for gif files and adds the Operator.

Comments

yobottehg created an issue. See original summary.

mondrake’s picture

Hi @yobottehg

I think that this should rather live as an image effect / image toolkit operation of its own. This way people could add a 'Coalesce' image effect to their image styles indipendently - you may want to do this also outside of resizing/scaling.

For that purpose, this is not the right place, as quoting myself from the module's home page

The intent is to provide a toolkit module that provides 'feature parity' to core's GD toolkit: i.e. only provide the general framework for integrating ImageMagick to the Image API, and the same image toolkit operations that core's GD toolkit provides (create_new, convert, crop, desaturate, resize, rotate, scale, scale_and_crop).

This could very well live in the Image Effects module. I'll be happy to review any patch over there.

mondrake’s picture

Status: Active » Needs review
mondrake’s picture

Status: Needs review » Closed (won't fix)
luksak’s picture

Status: Closed (won't fix) » Active
StatusFileSize
new933 bytes

I needed that functionality for a current project and re-rolled the patch.

May I question that decision to not include this in ImageMagick? Or has this been solved somewhere else by now?

mondrake’s picture

Version: 8.x-1.x-dev » 8.x-3.x-dev

See #2949193-2: ImageMagick scale breaks animated gifs (D8) and #1802534-33: ImageMagick scale breaks animated gifs.

However, I see this is a recurring request. I think it would be acceptable to have a setting in the 'Advanced image settings' that would allow to opt-in in a coalesce operation. Note that I believe the -coalesce argument should be added as the beginning of the arguments list (i.e. before any argument added by image toolkit operations), so somehow as part of the implementation of imagemagick_imagemagick_arguments_alter in imagemagick.module.

Patches welcome for the 8.x-3.x branch, for later porting to 8.x-2.x.

mondrake’s picture

Status: Active » Needs work
Chris Charlton’s picture

+1

mondrake’s picture

Title: Support animated Gif's » Support '-coalesce' of Animated GIF image files
Status: Needs work » Needs review
StatusFileSize
new10.24 KB

Here's a patch along the lines of #6. A new advanced setting is added to the image toolkit 'advanced' settings UI form; this allows to opt-in into a '-coalesce' operation anytime a multi-frame (Animated) GIF file is detected. The '-coalesce' argument is prepended to the other arguments so that any operation can rely on the dimensions of the frames to be consistent. Single-frame GIFs and other formats are not subject to the coalescence.

  • mondrake committed 9c304f3 on 8.x-3.x
    Issue #2786435 by mondrake, yobottehg, Lukas von Blarer: Support '-...
mondrake’s picture

Status: Needs review » Fixed

Committed to 8.x-3.x

mondrake’s picture

Issue tags: +release notes

Committed to 8.x-3.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.