i am using gifencoder
class but when i upload images it gives error
GIFEncoder V2.05: 0 Source is not a GIF image
below is the code
if (isset($_POST['speed'])) {
header('Content-type: image/gif');
if (isset($_POST['download'])) {
header('Content-Disposition: attachment;filename="animated.gif"');
}
include('GIFEncoder.class.php');
function frame($image) {
ob_start();
imagegif($image);
global $frames, $framed;
$frames[] = ob_get_contents();
$framed[] = $_POST['speed'];
ob_end_clean();
}
$cnt = count($_FILES);
for ($key = 1; $key <= $cnt; $key++) {
$tmp_name = $_FILES["images" . $key]["tmp_name"];
$im = imagecreatefrompng(file_get_contents($tmp_name));
$resized = imagecreatetruecolor($_POST['width'], $_POST['height']);
imagecopyresized($resized, $im, 0, 0, 0, 0, $_POST['width'], $_POST['height'], imagesx($im), imagesy($im));
frame($resized);
}
$gif = new GIFEncoder($frames, $framed, 0, 2, 0, 0, 0, 'bin');
echo $gif->GetAnimation();
}
I have tried to chnage mode from 'url' to 'bin' but its not working.