Hello I have added a simple image resize which is breaking my GIF animations. Could someone help me decipher here what needs to be removed from my existing code to allow that image to be uploaded and then be animated in GIF form...thank you for any input.
case 'addgift':
if($adminLevel == 4)
{
if ($_FILES['uploadedfile']['tmp_name'] != "")
{
$image = new SimpleImage();
$image->load($_FILES['uploadedfile']['tmp_name']);
$width = $image->getWidth();
$height = $image->getHeight();
if($width > 64) {
$height = (64/$width)*$height;
$width = 64;
}
if($height > 64) {
$width = (64/$height)*$width;
$height = 64;
}
$image->resize($width,$height);
if(preg_match("/\.(png)$/i", $_FILES['uploadedfile']['name']))
$type = IMAGETYPE_PNG;
else if(preg_match("/\.(gif)$/i", $_FILES['uploadedfile']['name']))
$type = IMAGETYPE_GIF;
else
$type = IMAGETYPE_JPEG;
$image->save("images/gifts/".$_FILES['uploadedfile']['name'], $type);
unlink($_FILES['uploadedfile']['tmp_name']);
mysql_query("INSERT INTO gifts
(name, image, cash, tokens)
VALUES ('".mysql_real_escape_string($_POST['name'])."', '".$_FILES['uploadedfile']['name']."', ".intval($_POST['cash']).", ".intval($_POST['tokens']).")");
mysql_query("INSERT INTO admin_actions
(id1, id2, action, extra, time)
VALUES($userid, 0, '{id1} added gift \"{extra}\".', '".mysql_real_escape_string($_POST['name'])."', UNIX_TIMESTAMP())");
}
}
break;