![Picture of László Zsidi Picture of László Zsidi](/graphics/unknown.gif)
László Zsidi - 2008-09-26 07:38:10 -
In reply to message 3 from Avinash Pawar
If I understand correctly, do you want that the GIFDecoder output will be a counted jpeg frame?
In this cause I can you give a simple solution.
1.: Simple catch the GIFDecoder outuput format into an array
2.: Make image pointer from array /frame by frame/ by the imageCreateFromString or imageCreateFromGif functions.
3.: Put back frames into the array as a countered jpeg file such as:
for ($i = 0; $i < count ( $decoded_gif_array ); $i++ ) {
$tmp = imageCreateFromString ( $decoded_gif_array [ $i ] );
ob_start();
imageJpeg ($tmp);
$jpg = ob_get_contents ();
ob_end_clean();
fwrite(fopen("frame_$i.jpg","wb"),$jpg);
imagedestroy($tmp);
imagedestroy($jpg);
}
Thats all!