hey just wondering if its possible to read animated gifs and possibly write them....
im just asking for a shuv in the right direction
anyideas?

    Have you read the GD manual? I know you can read animated gifs, not sure about writing them though...

    ~Brett

      Does gd support GIF images?
      Yes. Support for GIF was restored in gd 2.0.28 on July 21st, 2004. Support for creating GIF animations is also available. Note that gdlib-config --features can be used to list the image formats supported by gd. Versions of gdlib-config prior to recent updates do not support the --features option, which can be understood to mean that GIF is not available.

      There you go, straight from http://www.boutell.com/gd/faq.html

        thanks for your reply.

        i have looked it up in the GD manual and found these functions.

        gdImageGifAnimAdd
        gdImageGifAnimAddCtx
        gdImageGifAnimAddPtr
        gdImageGifAnimBegin
        gdImageGifAnimBeginCtx
        gdImageGifAnimBeginPtr
        gdImageGifAnimEnd
        gdImageGifAnimEndCtx
        gdImageGifAnimEndPtr

        however i dont think php supports them?

        any ideas?

          PHP doesn't support it no. But if the GD library is installed, they should work, just from a command line. Read up on creating the GD image from the command line. Then, if your server is set up for it, try using the "system" function or "exec" function to create the GD image for you.

          ~Brett

            ok after more research i found that GD wasnt able to write to animated gif's until 2.0.29 whereas my hosting package only has 2.0.28.

            also i've been googling creating "images from command line php" etc.. and cant seem to come up with anything but C# examples ? :queasy:

            does anyone know of a tutorial?

              Well, it's not PHP command line, it's Unix command line. So you'd be executing code like:

              $command = 'im = gdImageCreate(100, 100);
              gdImageDestroy(im);'
              
              $command = escapeshellarg(escapeshellcmd($command));
              $image = shell_exec($command);

              Something like that is how you'd use the command line. I can't guarantee it 100%, but that's the basics (I believe).

              ~Brett

                Write a Reply...