LiipImagineBundle icon indicating copy to clipboard operation
LiipImagineBundle copied to clipboard

So, what about resizing animated GIFs?

Open wtorsi opened this issue 8 years ago • 6 comments

Hi, I've used this Filter to resize images in custom FilterLoader Maybe the problem is in my mac?

public function apply(ImageInterface $image)
    {
        $isAnimated = count($image->layers()) > 1;

        if($isAnimated === true){
            $image->layers()->coalesce();
            /** @var ImageInterface $frame */
            foreach ($image->layers() as $frame){
                $frame->resize($this->size, $this->filter);
            }
            $image->layers()->merge();

        } else {
            $image->resize($this->size, $this->filter);
        }

        return $image;
    }

With this config

liip_imagine:
  driver:               imagick
  filter_sets:
      default:
          jpeg_quality: 90
          png_compression_level: 9
          animated: true

But, in the result i got the image with bad quality and not animated :) . Maybe I did something wrong?

wtorsi avatar Oct 19 '16 19:10 wtorsi

fundamentally we use the imagine lib for resizing. so first check there if animated gifs are supported .. it looks like there is some support for it : https://github.com/avalanche123/Imagine/search?utf8=✓&q=animated

lsmith77 avatar Nov 04 '16 08:11 lsmith77

Anyone solved this issue?

An example would be great. If provided i promise i will make a PR to documentation with it.

malas avatar Apr 19 '17 14:04 malas

Digging this back up ... anyone has an example of working with animated GIFs?

sujayjaju avatar Apr 02 '19 08:04 sujayjaju

Same as @sujayjaju, anyone has an example of working with animated GIFs?

todomagichere avatar Mar 05 '21 12:03 todomagichere

Same as @sujayjaju and @todomagichere , has anyone been able to load an animated GIF or PNG?

xavicorral avatar Mar 16 '22 08:03 xavicorral

What's the latest with this? Anyone manage to get this to work?

Jayohhtchen avatar Sep 15 '22 00:09 Jayohhtchen