# Create animated gif from images in DB

**URL:** <https://www.ruby-forum.com/t/create-animated-gif-from-images-in-db/187776>\
**Category:** Rails\
**Created:** [April 29, 2010, 3:47am UTC](https://www.ruby-forum.com/t/create-animated-gif-from-images-in-db/187776 "2010-04-29T03:47:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![slindsey3000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@slindsey3000](https://www.ruby-forum.com/u/slindsey3000)\
**Post date:** [April 29, 2010, 3:47am UTC](https://www.ruby-forum.com/t/create-animated-gif-from-images-in-db/187776/1 "2010-04-29T03:47:07Z")

</div>

Hi all anyone got an idea of how to create an animated gif using  
images uploaded in paperclip?

OR

some way to display rotating images in rails.

(i’m trying to create rotating sponsor images on the fly from user  
uploads)

Thanks,

Shawn

---

<div class="post-metadata">

**Author:** ![slindsey3000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@slindsey3000](https://www.ruby-forum.com/u/slindsey3000)\
**Post date:** [April 29, 2010, 5:20am UTC](https://www.ruby-forum.com/t/create-animated-gif-from-images-in-db/187776/2 "2010-04-29T05:20:25Z")

</div>

slindsey3000 wrote:

> Hi all anyone got an idea of how to create an animated gif using  
> images uploaded in paperclip?
> 
> OR
> 
> some way to display rotating images in rails.
> 
> (i’m trying to create rotating sponsor images on the fly from user  
> uploads)

You don’t need to make animated GIFs for that. All you need is  
JavaScript.

Here’s a fine example of rotating images with a nice cross-desolve  
effect. No animated GIFs and no Flash necessary:

> **[iPad](https://www.apple.com/ipad/)**
>
> Explore the world of iPad. Featuring the all-new iPad and iPad Pro, and the powerful iPad Air and iPad mini.

---

<div class="post-metadata">

**Author:** ![slindsey3000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@slindsey3000](https://www.ruby-forum.com/u/slindsey3000)\
**Post date:** [April 29, 2010, 9:17am UTC](https://www.ruby-forum.com/t/create-animated-gif-from-images-in-db/187776/3 "2010-04-29T09:17:14Z")

</div>

If you want to go onto the animated gif direction, i believe the only  
option you have is to look at ImageMagick and RMagick, but this is not  
trivial stuff.

On the other side, Javascript and modern browsers (like Safari and  
FireFox) can help you with something like :

a=0;  
setInterval(function(){  
a++;  
var d=document.getElementById(‘YourImageId’);  
d.style[’-webkit-transform’]=‘rotate(’+a+‘deg)’  
d.style[’-moz-transform’]=‘rotate(’+a+‘deg)’  
},15)

Hope this helps,

Christophe  
Le 29 avr. 2010 à 03:45, slindsey3000 a écrit :
