Jump to content

animated gif images not working after resize


benbyf
 Share

Recommended Posts

Hi!

I have a image field with

echo image->size(300,300)->url;

here: http://nicegrp.co.uk/dev/mpa/

which when a gif is added the animation works fine.

however on another page: http://nicegrp.co.uk/dev/mpa/illustrators/melvin-galapon/ im using:

echo image->size(300,0)->url;

the animation is not retained, cant see any other differences.

Edited by horst
edited the subject to show that it is related to animated GIFs only
Link to comment
Share on other sites

Hi there!

Your first image seems to be 500x500 in size, actually, just scaled down using styles. Could that be the original size, perhaps?

Second image has "500x500.300x0" in it's filename, which looks a bit weird (are these both added by ProcessWire?) and is actually 300x300 in size. Guessing this is the downscaled version.

Haven't tried these with ProcessWire, but I've seen image resizing destroy animations in GIF files before. That might be happening here too -- Horst should probably take a look at this, he's the one who knows best what's happening. A very quick Google search resulted in this thread, which seems to suggest that GD resize might need extra work to support animated GIFs :)

For the record: if possible, I'd suggest that you create a new GitHub issue for this.

  • Like 2
Link to comment
Share on other sites

OMG. Animated gifs! I suddenly feel so retro. :)

But seriously, PW with GD-lib doesn't support this. And as your request now seems to be the first that arrives here, it shows that this is a really rare case today.

Teppo already has done a good recherche on that and it shows that this is not a small piece of work. I don't think that Ryan would want a full support for that to go into the core. (If not more than 20% or 30%? of the users need this it has to go into a module).

But you need a quick solution now.

You may check if your host supports IMAGICK, (not 'ImageMagick', but 'ImageMagick' through a PHP-Extension called 'Imagick'). If yes, install and try out ImagickResizer. I don't know if it supports animated GIFs yet, but there is a good chance it does.

If this doesn't work for you, can you display them just with "resizing" by css dimensions? (Is this the only case where you need this)

If above both doesn't work, I think the only thing what can be done quickly is to implement a check for animated GIFs into the Imagesizer (or maybe as a workaround, into your template code) and if it is a animated one, redirect the manipulation to one of the mentioned LIBs at StackOverflow.

  • Like 2
Link to comment
Share on other sites

  • 8 years later...

Hey, welcome to the forums.

It would be good to know your setup (modules, PW version) and such a bit more precise.

So, quick question: do you use a PW version greater than 3.0.89 AND is there installed the "Modules > Core > Image > Animated GIF Image Sizer" module?
(https://processwire.com/talk/topic/18387-pw-3090-–-core-updates/)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...