Handling GIFs upload in the Panel

Hi there,

I’m experiencing a recurring issue across several projects. I use the following blueprint for images in most of my Kirby projects:

title: Image
accept: image/jpeg, image/png, image/gif
create:
  width: 2560

This setup works well for most use cases, particularly because the resizing on upload helps prevent heavy image files. However, I’ve encountered a problem with GIFs: they are replaced by non-animated versions upon upload, even when they are not resized. If I remove the create.width option, GIF files can be uploaded without modification, but then JPEGs and PNGs are no longer resized of course.

I’m unsure whether this is a bug (why would files that do not need resizing be modified anyway?) or if it’s intentional. But how can I resolve this issue?

Thanks in advance!

Are you ising the default GD image driver? GD cannot resize animated gifs and retain the animation, you will get a gif s a result but it will be just the very first frame of the animation.

I would suggest if it is available on your web hosting, to switch to using ImageMagick instead, whic is capable of resizing Aanimated gifs and retaining the animation.

Yes, I’m using the default GD driver, as IM is rarely available on shared hosting unfortunately. But it seems to me that files that don’t need to be resized (which is almost always the case, as GIFs are usually quite small in size) shouldn’t go through the resizing process that will remove the animation

If you are sure that IM isnt available, a work around could be to overide the file component so that the Gif gets serverd from the content folder after it has been uploaded rather then passing it through the thumb driver for manipulation and getting served from the media folder.

There is an article on this here: