note 64389 added to function.imagegif
| From: | zsidi dot laszlo at chello dot hu | Date: | Thu, 13 Apr 2006 10:33:51 +0000 |
| Subject: | note 64389 added to function.imagegif | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-107966@lists.php.net to get a copy of this message | ||
Hi! Do you want to create animated gif from single gif frames with pure php code?
please, i rewrite '1998 Peter Kleiweg MergeGif 1.0d C version' into pure php version.
Part 1:
<?php
/*
(C) 2006 László Zsidi GifMerge 1.0
==================================
This program is a rewrite php port of
(C) 1998 Peter Kleiweg MergeGif 1.0d
C version.
*/
/*///////////////////////////////////////////////*/
/*// //*/
/*// G I F M E R G E . P H P //*/
/*// //*/
/*///////////////////////////////////////////////*/
/*///////////////////////////////////////////////*/
/*// V A R I A B L E S //*/
/*///////////////////////////////////////////////*/
$ver = "1.0";
/*///////////////////////////////////////////////*/
/*// B O O L E A N S //*/
/*///////////////////////////////////////////////*/
$first = true;
$debug = false;
$use_loop = false;
$transparent = false;
$use_global_in = false;
/*///////////////////////////////////////////////*/
/*// I N T E G E R S & C H A R S //*/
/*///////////////////////////////////////////////*/
$x = 0;
$y = 0;
$fin = 0;
$fout = '';
$delay = 50;
$width = 0;
$height = 0;
$trans1 = 255;
$trans2 = 255;
$trans3 = 255;
$disposal = 2;
$out_color_table_size = 0;
$local_color_table_flag = 0;
$global_color_table_size = 0;
$out_color_table_sizecode = 0;
$global_color_table_sizecode = 0;
/*///////////////////////////////////////////////*/
/*// A R R A Y S //*/
/*///////////////////////////////////////////////*/
$gif = array(0x47, 0x49, 0x46); // <= GIF
$buffer = array();
$local_in = array();
$global_in = array();
$global_out = array();
$logical_screen_descriptor = array();
$netscape = array(
0x21,
0xFF,
0x0B,
0x4e,
0x45,
0x54,
0x53,
0x43,
0x41,
0x50,
0x45,
0x32,
0x2e,
0x30,
0x03,
0x01,
0x00,
0x00,
0x00 );
/*///////////////////////////////////////////////*/
/*// F U N C T I O N S //*/
/*///////////////////////////////////////////////*/
/*///////////////////////////////////////////////*/
/*// Function :: gifmerge() //*/
/*///////////////////////////////////////////////*/
function gifmerge($images, $t1, $t2, $t3, $loop, $dl, $dp, $xpos, $ypos)
{
global $fout, $netscape, $debug, $original_dimensions, $disposal,
$use_loop, $transparent, $trans1, $trans2, $trans3, $delay, $x, $y;
if($debug) print "GifMerge debugger...\n<br>";
if($loop)
{
$netscape[16] = $loop & 255;
$netscape[17] = $loop >> 8;
$use_loop = true;
}
if($t1 && $t2 && $t3)
{
$trans1 = $t1;
$trans2 = $t2;
$trans3 = $t3;
$transparent = true;
}
if($dl)
{
$delay = $dl;
}
if($dp)
{
$disposal = $dp;
}
if($xpos)
{
$x = $xpos;
}
if($ypos)
{
$y = $ypos;
}
for($i = 0; $i < count($images); $i++)
{
start_gifmerge_process($images[$i]);
}
return $fout;
}
----
Server IP: 195.70.37.52
Probable Submitter: 195.56.140.24
----
X-Spam-Status: No, hits=3.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HTML_MESSAGE autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.imagegif.php
Edit -- http://master.php.net/note/edit/64389
Del: integrated -- http://master.php.net/note/delete/64389/integrated
Del: useless -- http://master.php.net/note/delete/64389/useless
Del: bad code -- http://master.php.net/note/delete/64389/bad+code
Del: spam -- http://master.php.net/note/delete/64389/spam
Del: non-english -- http://master.php.net/note/delete/64389/non-english
Del: in docs -- http://master.php.net/note/delete/64389/in+docs
Del: other reasons-- http://master.php.net/note/delete/64389
Reject -- http://master.php.net/note/reject/64389
Search -- http://master.php.net/manage/user-notes.php