Jump to content
benbyf

animated gif images not working after resize

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Mithlesh
      Changing it to null
    • By Mithlesh
      Hi, I have one URL - writerrelocations.com/contact-now/

      I have one issue where my header Image is appearing again after the contact form, for your reference:



      I have checked my processwire template section where have not added any Image field besides Header Image, attaching the same for the reference:




      PLEASE help me to get rid of the image below contact form

      Waiting for the swift response!

      Thanks
       
    • By tonicastillo
      Hi. Can I ask why this happens?
      When I upload a jpg, the meta keywords and description of the file loses the accents and spanish symbols of the words.
      Original image on the left, and the image generated by PW on resize on the right.

      This happens on resize. The uploaded file is ok.
      How can I control which meta keep in the photo?
      Thanks a lot (and sorry for my English)...
    • By nabo
      Hello
      I'm working on a project that use PW as backend CMS. PW serves formatted data of each page but the engine simply generates json from pagearray.
      I would like to set one or more variations on images, so I think it would be useful if there were a field to set possible variations... even with overrides!
×
×
  • Create New...