function resizer_main($image, $dest_file_prefix,$w, $h){
global $use_imagecreatetruecolor, $use_imagecopyresampled, $IMG_ROOT, $JPG_QUALITY, $HTTP_POST_FILES;
$image_name = $HTTP_POST_FILES [$image]["name"];
$image = $HTTP_POST_FILES [$image]["tmp_name"];
if(trim($image) == "" || trim($image) =="none") return false;
$arr_img = image_from_upload($image);
if( $arr_img["w"] != $w && $arr_img["h"] != $h){
$wh = get_sizes($arr_img["w"], $arr_img["h"], $w, $h);
$img_res = img_get_resized(
$arr_img["img"],
$arr_img["w"], $arr_img["h"],
$wh["w"], $wh["h"],
$use_imagecreatetruecolor,
$use_imagecopyresampled);
} else {
//wow it is exactly like needed!!!
$img_res = $arr_img["img"];
}
$file_name = make_filename($image_name, $dest_file_prefix);
ImageJPEG($img_res,"$IMG_ROOT/$dest_file_prefix$file_name", $JPG_QUALITY);
return "$dest_file_prefix$file_name";
}