PHP Classes

You should have added an exemple with a binary-data image.

Recommend this page to a friend!

      GIF images into animated GIF with native PHP class  >  All threads  >  You should have added an exemple...  >  (Un) Subscribe thread alerts  
Subject:You should have added an exemple...
Summary:Package rating comment
Messages:5
Author:daniel miao
Date:2007-12-22 15:34:26
Update:2007-12-24 03:37:00
 

daniel miao rated this package as follows:

Utility: Good
Consistency: Not sure
Examples: Bad

  1. You should have added an exemple...   Reply   Report abuse  
Picture of daniel miao daniel miao - 2007-12-22 15:34:26
You should have added an exemple with a binary-data image.

  2. Re: You should have added an exemple...   Reply   Report abuse  
Picture of László Zsidi László Zsidi - 2007-12-22 20:44:27 - In reply to message 1 from daniel miao
Did you mean such a binary-data which has been created by binary php functions?

Please, let me know whatever you want to know about binary function of zhis class?

  3. Re: You should have added an exemple...   Reply   Report abuse  
Picture of daniel miao daniel miao - 2007-12-23 15:30:30 - In reply to message 2 from László Zsidi
Thank for the quick reply,

When i tryed to use images that was created by imagecreatefromgif(url) and i added them some text, it said that the images weren't valid gif images, can you check it?

thank you. Daniel

  4. Re: You should have added an exemple...   Reply   Report abuse  
Picture of László Zsidi László Zsidi - 2007-12-24 03:28:32 - In reply to message 3 from daniel miao
The solution is very simple and very effective:)
Must be used the ob_start and ob_get_contents functions to pass the variables that have conatints binary-image-data into the class constructor such as:

<?php
$frames = array ( );
$framed = array ( );
$original = imagecreatefromgif("original_gif_image.gif");
/* $edited = Made some additional text functions... */
imagedestroy ( $original );
ob_start ( );
imagegif ( $edited );
$frames [ ] = ob_get_contents ( );
$framed [ ] = /* Your own delayed times */
ob_end_clean ( );

/* Must be used to construct class the 'bin' flag instead of 'url' flag */
$GIF = new GIFEncoder ( $frames , $framed , 0, 2, -1, -1, -1, "bin" );
header ( 'Content-type:image/gif' );
header ( 'Content-disposition:attachment;filename=testanim.gif' );
echo $GIF->GetAnimation ( );
?>

  5. Re: You should have added an exemple...   Reply   Report abuse  
Picture of László Zsidi László Zsidi - 2007-12-24 03:37:00 - In reply to message 4 from László Zsidi
More additional informations can be found at the http://www.phpclasses.org/discuss/package/3163/thread/1/ C_MEMORY topic about the binary-image-content functions.
Don't wonder, this topic created for the older GIFEncoder version and there was used C_MEMORY flag instead of "bin" flag.