PHP / ImageMagick - Animate on the Fly

Discussion in 'PHP or PERL Snips' started by doctorallia, Sep 19, 2005.

  1. doctorallia

    doctorallia Perch

    The following code will take two images and make an animated gif on the fly using ImageMagick.


    $path "/home/hsphere/local/home/USERNAME/";

    //THE COMMAND TO MAKE THE ANIMATION HAPPEN add more images if ya need to
    $cmd "/usr/local/bin/convert -dispose none -delay 20 FIRSTIMAGE.gif -delay 20 SECONDIMAGE.gif -loop 0 $path/animatedimage.gif"

    exec("$cmd 2>&1"$err); 

    $err as $errline){ 

    <!--display the animated image-->
    <img src='animatedimage.gif'>

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services