Problem/Motivation

The gif-resizer library is inefficient for optimized (combine) GIFs, causing a massive quality drop on the re-sized image. Link for similar issue with the same result on gif-resizer support forum: http://www.phpclasses.org/discuss/package/7353/thread/5/

Proposed resolution

Add use of ImageMagick PHP extension (if available) on animgif_support_image_resizer function. Imagick manages to successfully re-size optimized combine GIFs with close to no quality loss, the only drawback is an increase in the re-sized image file size compared to the original image.

Comments

artureiji created an issue. See original summary.

artureiji’s picture

Though this might depend on fixing the gif-resizer library, I was able to resolve with ImageMagick as it easily solves the problem with success. Attached patch with solution.

artureiji’s picture

StatusFileSize
new2.26 KB

Updating the patch code with better practices and standards.

a.gursoy’s picture

Thank you for patch. It's working but sometime makes server cpu %200.
@artureiji Do you have this kind of problem?

denes.szabo’s picture

Assigned: Unassigned » denes.szabo
Status: Active » Needs review

@artureiji Thanks for the patch! Just committed your patch http://cgit.drupalcode.org/animgif_support/commit/?h=7.x-1.x&id=11c084fc...

I found few issues:

return $gr->resize($source_image, $resized_image, $width, $height);

There was no $source_image, $resized_image variables in your function… The $gr->resize() returns nothing, so the image was not made at last if you used gifResizer lib. Both issue has fixed.
And please setup your editor for use the correct Drupal coding standards - was few indent issue after patching the original file.

But, thanks again! Btw, we need to test the whole animated gif generation with php-imagemagick, but without the animgif_support module. I suspect, if the imagemagick is present then no need this module at all can be disabled (so, no need imagick support to this module).

denes.szabo’s picture

Status: Needs review » Fixed

Seems no feedback. Let's roll out a stable release to get feedback…

denes.szabo’s picture

Status: Fixed » Closed (fixed)