( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
include "newdatasets/GIFEncoder.class.php";
/*
Build a frames array from sources...
*/
if ( $dh = opendir ( "v/uploads/gif/" ) ) {
while ( false !== ( $dat = readdir ( $dh ) ) ) {
if ( $dat != "." && $dat != ".." ) {
$frames [ ] = "v/uploads/gif/$dat";
$framed [ ] = 500;
}
}
closedir ( $dh );
}
/*
GIFEncoder constructor:
=======================
image_stream = new GIFEncoder (
URL or Binary data 'Sources'
int 'Delay times'
int 'Animation loops'
int 'Disposal'
int 'Transparent red, green, blue colors'
int 'Source type'
);
*/
$gif = new GIFEncoder (
$frames,
$framed,
2,
2,
0, 0, 1,
"url"
);
/*
Possibles outputs:
==================
Output as GIF for browsers :
- Header ( 'Content-type:image/gif' );
Output as GIF for browsers with filename:
- Header ( 'Content-disposition:Attachment;filename=myanimation.gif');
Output as file to store into a specified file:
- FWrite ( FOpen ( "myanimation.gif", "wb" ), $gif->GetAnimation ( ) );
*/
$random = md5(rand(11,99));
FWrite ( FOpen ( "v/uploads/raw/anim$random.gif", "wb" ), $gif->GetAnimation ( ) );
$theme_id = $_GET['theme_id'];
$nani = $_GET['nani'];
Header ( 'Content-type:image/gif' );
echo $gif->GetAnimation ( );
?>