# Animated GIFs

**URL:** <https://community.transloadit.com/t/animated-gifs/18053>\
**Category:** Transloadit\
**Tags:** tender-archive\
**Created:** [January 16, 2012, 9:37pm UTC](https://community.transloadit.com/t/animated-gifs/18053 "2012-01-16T21:37:00Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabe.ragland](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/gabe.ragland/32/1461_2.png) [@gabe.ragland](https://community.transloadit.com/u/gabe.ragland)\
**Post date:** [January 16, 2012, 9:37pm UTC](https://community.transloadit.com/t/animated-gifs/18053/1 "2012-01-16T21:37:00Z")

</div>

> Archived from the Transloadit support forum. Originally posted on January 16, 2012; details may be outdated, see [our docs](https://transloadit.com/docs/) for current behavior. [Original thread](https://web.archive.org/web/20120617204725/http://support.transloadit.com/discussions/problems/386-animated-gifs)

I’ve noticed that the majority of animated gifs upload don’t maintain their animation. Did you guys change something about how you handle animated gifs?

This is the template I’m using: [https://transloadit.com/templates/view/REDACTED](https://transloadit.com/templates/view/REDACTED)

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [January 17, 2012, 7:33am UTC](https://community.transloadit.com/t/animated-gifs/18053/2 "2012-01-17T07:33:00Z")

</div>

Hey Gabe,

nope we did not change anything regarding this.

But I see you use the frame: 1 parameter and strip: true. This could already be the cause of only one frame to be used.

Has this worked in the past with this template?

Also all system tests that check for animated gifs still pass.

Kind regards  
Tim

---

<div class="post-metadata">

**Author:** ![gabe.ragland](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/gabe.ragland/32/1461_2.png) [@gabe.ragland](https://community.transloadit.com/u/gabe.ragland)\
**Post date:** [January 17, 2012, 7:40am UTC](https://community.transloadit.com/t/animated-gifs/18053/3 "2012-01-17T07:40:00Z")

</div>

We don’t use frame:1 for the large image size, just for the thumbnails.  
Does strip:true for the large image size strip out the other frames of the animated gif? Can’t remember, but we may have added that to the template recently, so that could be the problem.

Thanks  
Gabe

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [January 17, 2012, 7:44am UTC](https://community.transloadit.com/t/animated-gifs/18053/4 "2012-01-17T07:44:00Z")

</div>

Hey Gabe,

strip: true strips all meta data, including the frame information AFAIK.

It’s worth a try. Let me know if you want me to do it to confirm this first.

Kind regards  
Tim

---

<div class="post-metadata">

**Author:** ![gabe.ragland](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/gabe.ragland/32/1461_2.png) [@gabe.ragland](https://community.transloadit.com/u/gabe.ragland)\
**Post date:** [January 17, 2012, 7:57am UTC](https://community.transloadit.com/t/animated-gifs/18053/5 "2012-01-17T07:57:00Z")

</div>

I just took out strip for the large image size and I still get a non-animated gif when I upload this file: [http://i.imgur.com/2qWav.gif](http://i.imgur.com/2qWav.gif)

Thanks  
Gabe

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [January 17, 2012, 8:04am UTC](https://community.transloadit.com/t/animated-gifs/18053/6 "2012-01-17T08:04:00Z")

</div>

I see. I was able to reproduce it as well. This is really weird.

I will debug this once I am in the office and will then get back to you.

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [January 17, 2012, 9:01am UTC](https://community.transloadit.com/t/animated-gifs/18053/7 "2012-01-17T09:01:00Z")

</div>

Hey Gabe,

I debugged this. The problem is the flatten parameter, which has a default value of true, which solves quite a few issues. This does not work for gif files though, as it loses the animation.

I think the best way to solve this would be to have a default value of “auto” which flattens all non-gif conversions, but not gif-conversions. What do you think?

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [January 17, 2012, 9:02am UTC](https://community.transloadit.com/t/animated-gifs/18053/8 "2012-01-17T09:02:00Z")

</div>

Alternatively we could just keep it as it is and do not flatten gif files, even though the flatten parameter is set to “true”. To deal with animated gif files, people could still make use of the “frame” parameter.

---

<div class="post-metadata">

**Author:** ![gabe.ragland](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/gabe.ragland/32/1461_2.png) [@gabe.ragland](https://community.transloadit.com/u/gabe.ragland)\
**Post date:** [January 17, 2012, 9:14am UTC](https://community.transloadit.com/t/animated-gifs/18053/9 "2012-01-17T09:14:00Z")

</div>

I’m not really familiar with the flatten param, as I don’t deal with transparent images, but the first suggestion seems reasonable to me.

I also wanted to ask if this would be possible.. Are there any template rules that would enable me to produce a non-animated gif if the file size is above 1mb, and instead watermark another image over it (a play button icon)? If the file size is below 1mb it would create an animated gif.

I remember reading at some point (but cant find it now) a way to reference image meta-data, such as filesize, in the template to change it’s behavior on the fly.

Thanks  
Gabe

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [January 17, 2012, 9:20am UTC](https://community.transloadit.com/t/animated-gifs/18053/10 "2012-01-17T09:20:00Z")

</div>

For that you’d need the file/filter robot: [http://transloadit.com/docs/file-filter](http://transloadit.com/docs/file-filter)

Regarding the flatten parameter, I think I will keep it as it is and just not flatten gif files for now, as you cannot specify which frame to use with the flatten parameter anyway.

For gif files, you’d use the frame parameter. I think the expected behavior is to preserve animations by default.

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [January 17, 2012, 9:24am UTC](https://community.transloadit.com/t/animated-gifs/18053/11 "2012-01-17T09:24:00Z")

</div>

Okay the new behavior is deployed and the docs for the flatten parameter are updated: [http://transloadit.com/docs/image-resize](http://transloadit.com/docs/image-resize)

Can you please confirm, that gifs work for you now, Gabe?

Thanks again for reporting this!

---

<div class="post-metadata">

**Author:** ![gabe.ragland](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/gabe.ragland/32/1461_2.png) [@gabe.ragland](https://community.transloadit.com/u/gabe.ragland)\
**Post date:** [January 17, 2012, 9:31am UTC](https://community.transloadit.com/t/animated-gifs/18053/12 "2012-01-17T09:31:00Z")

</div>

Yep, animated gifs are working now. Thanks Tim!

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [January 17, 2012, 9:33am UTC](https://community.transloadit.com/t/animated-gifs/18053/13 "2012-01-17T09:33:00Z")

</div>

Perfect.

Again thanks for reporting this.

Closed.

---

<div class="post-metadata">

**Author:** ![gabe.ragland](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/gabe.ragland/32/1461_2.png) [@gabe.ragland](https://community.transloadit.com/u/gabe.ragland)\
**Post date:** [January 17, 2012, 10:49pm UTC](https://community.transloadit.com/t/animated-gifs/18053/14 "2012-01-17T22:49:00Z")

</div>

Hey Tim,

I also wanted to ask if this would be possible.. If the animated gif file size  
is above 1mb I’d like to produce an animated gif as well as a non-animated gif that contains a watermark of another image (a play button icon)? If the file size is below 1mb it would just create the one animated gif.

I remember reading at some point (but cant find it now) a way to reference image meta-data, such as filesize, in the template to change it’s behavior on the fly.

Would that be possible? Or would the best way to do this be to do a second call to your api after my callback is url hit by your server, and create the non-animated gif then using a different template?

Thanks  
Gabe

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [January 18, 2012, 6:52am UTC](https://community.transloadit.com/t/animated-gifs/18053/15 "2012-01-18T06:52:00Z")

</div>

Hey Gabe,

you could again use the /file/filter robot for it.  
Since you create the animated gif file in both cases, we can trim the problem down to just creating a watermarked version for files \> 1mb.

Here is some pseudo template:

: /file/filter, proper condition, use original wm\_version: use gif\_gt\_1mb, /image/resize robot, watermark parameters

The gist here is, that gif\_gt\_1mb file could pass zero files on to the wm\_version step (in case the original file was below 1mb), hence the wm\_version step would do nothing.

That’s all that you need. Here are the docs again: [http://transloadit.com/docs/file-filter](http://transloadit.com/docs/file-filter)

Let me know if you need further help.

Tim

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex032/uploads/transloadit/original/1X/04ee57da0cb7ac8728a9ac5965c288164f4ce280.svg) [@system](https://community.transloadit.com/u/system)\
**Post date:** [October 7, 2026, 9:55am UTC](https://community.transloadit.com/t/animated-gifs/18053/16 "2026-10-07T09:55:19Z")

</div>


