Out put

Recommend this page to a friend!

      GIF images into animated GIF with native PHP class  >  All threads  >  Out put  >  (Un) Subscribe thread alerts  
Subject:Out put
Summary:not gif, gif?
Messages:5
Author:luke
Date:2006-11-03 22:18:55
Update:2007-01-30 04:19:02
 

  1. Out put   Reply   Report abuse  
Picture of luke luke - 2006-11-03 22:18:55
hey i have used that to produce a animate gif, then used a simple script that loads the image with image GDlib in php. but it keeps saying,

'example.php' is not a valid GIF file

i have used other meathods, i need it to out put it in a way php can 'read it' or out put completttly as a gif file i have tried this

function getAnimation()
{
return $this->fout;

$file_handle = fopen('radimg.gif', 'r+');

fwrite($file_handle, $this->fout);
fclose($file_handle);
}
in the class file but does not produce it in another file, is there any way for this to work, thanks :)

  2. Re: Out put   Reply   Report abuse  
Picture of László Zsidi László Zsidi - 2006-11-06 05:03:37 - In reply to message 1 from luke
Hi,

GifMerge output is a binary stream ( no GD stream ) I just thought try to set the content disposition.
E.g.:
header ( 'Content-disposition: attachment;filename=file.gif' );

  3. Re: Out put   Reply   Report abuse  
Picture of eddy ammar eddy ammar - 2007-01-29 06:00:51 - In reply to message 2 from László Zsidi
HI László, this is a very nice module! So if I need to write the output to a file, can you please give me an example of the codes needed?

I tried using file_put_contents, but the saved image file lose its transparency & its image appears a bit corrupted.

Please help! Thanks a lot.

  4. Re: Out put   Reply   Report abuse  
Picture of László Zsidi László Zsidi - 2007-01-29 20:58:13 - In reply to message 3 from eddy ammar
Hi,

If you want to save animation into a specified file you can easily:

$gif = new GifMerge ( ... );

fwrite ( fopen ( "mygif.gif", "wb" ), $gif->GetAnimation ( ) );

Regards,
László Zsidi

  5. Re: Out put   Reply   Report abuse  
Picture of eddy ammar eddy ammar - 2007-01-30 04:19:02 - In reply to message 4 from László Zsidi
Excellent reply László! Thanks a bunch. And keep up the good work bro!

 

For more information send a message to info at phpclasses dot org.