Error : ".$error."";
}
//+================================================+
function display_results(){
global $_CONFIG, $extension, $filename;
echo '';
}
//+================================================+
function file_type($file){
$path_chunks = explode("/", $file);
$thefile = $path_chunks[count($path_chunks) - 1];
$dotpos = strrpos($thefile, ".");
return strtolower(substr($thefile, $dotpos + 1));
}
//+================================================+
function createthumbs($name,$filename,$new_w,$new_h)
{
global $extension;
if(extension_loaded("gd2") || extension_loaded("gd")) {
if($extension == "jpeg" || $extension == "jpg" || $extension == "gif" || $extension == "png"){
$system=explode(".",$name);
if($extension == "jpeg" || $extension == "jpg"){
$src_img=imagecreatefromjpeg($name);
}
if($extension == "png"){
$src_img=imagecreatefrompng($name);
}
if($extension == "gif"){
$src_img=imagecreatefromgif($name);
}
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x > $old_y) {
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y) {
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y) {
$thumb_w=$new_w;
$thumb_h=$new_h;
}
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
if ($extension == "png"){
imagepng($dst_img,$filename);
} else {
imagejpeg($dst_img,$filename);
}
imagedestroy($dst_img);
imagedestroy($src_img);
}
}
}
?>