Hey guys.. I'm having some GD woes here..
I'm trying to create thumbnails from GIFs, JPGs and PNGs. I think I've cracked writing the jpgs and pngs - but I'm having a rough time with the gif...
$img_type = $img_info[2];
switch($img_type) {
case "1":
$source_img = imagecreatefromgif($image_path);
$dest_img = imagecreate($width,$height);
$sized = imagecopyresized($dest_img,$source_img,0,0,0,0, $width,$height,imagesx($source_img),imag esy($source_img));
$created = imagegif($dest_img, $thumb_path, 75);
if($sized && $created) {
return $pic;
} else {
return 0;
}
break;
It keeps on coming back with imagegif not defined... You can read gifs, you just can't write them because of the copyright.
Anyone have any ideas for a workaround...?
Problem solved - thanks!
-Shade
I'm trying to create thumbnails from GIFs, JPGs and PNGs. I think I've cracked writing the jpgs and pngs - but I'm having a rough time with the gif...
$img_type = $img_info[2];
switch($img_type) {
case "1":
$source_img = imagecreatefromgif($image_path);
$dest_img = imagecreate($width,$height);
$sized = imagecopyresized($dest_img,$source_img,0,0,0,0,
$created = imagegif($dest_img, $thumb_path, 75);
if($sized && $created) {
return $pic;
} else {
return 0;
}
break;
It keeps on coming back with imagegif not defined... You can read gifs, you just can't write them because of the copyright.
Problem solved - thanks!
-Shade
