ExecQuery ("select image,img_w,img_h,image_type img_type from $table where id='$id'"); if ($image->rowsSQL[0]["img_type"] == "1") { $size = minimizer($image->rowsSQL[0]["img_w"],$image->rowsSQL[0]["img_h"],$w,$h); $src_img = imagecreatefromstring($image->rowsSQL[0]["image"]); $dst_img = imagecreatetruecolor($size["w"],$size["h"]); imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $size["w"], $size["h"], $image->rowsSQL[0]["img_w"], $image->rowsSQL[0]["img_h"]); imagejpeg($dst_img); imagedestroy($src_img); imagedestroy($dst_img); } elseif ($image->rowsSQL[0]["img_type"] == "2") { $size = minimizer($image->rowsSQL[0]["img_w"],$image->rowsSQL[0]["img_h"],$w,$h); $src_img = imagecreatefromstring($image->rowsSQL[0]["image"]); $dst_img = imagecreatetruecolor($size["w"],$size["h"]); imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $size["w"], $size["h"], $image->rowsSQL[0]["img_w"], $image->rowsSQL[0]["img_h"]); imagejpeg($dst_img, "", 90); imagedestroy($src_img); imagedestroy($dst_img); } ?>