this is the script that I use to resize image..
<?php$a = "images/".$_GET['src'];$b = $_GET['w'];$ext = explode(".",$_GET['src']);$ext = end($ext);$ext = strtolower($ext);if ($ext == "jpg") { header ("Content-type: image/jpeg"); }else if ($ext == "gif") { header ("Content-type: image/gif"); }else if ($ext == "png") { header ("Content-type: image/png"); }if ($ext == "jpg") { $img_src=imagecreatefromjpeg($a); }else if ($ext == "gif") { $img_src=imagecreatefromgif($a); }else if ($ext == "png") { $img_src=imagecreatefrompng($a); }$size = getimagesize($a);if ($b >= $size[0]) $b = $size[0];$c = round($b * $size[1] / $size[0]);$img_dst=imagecreatetruecolor($b,$c);imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $b, $c, $size[0], $size[1]);if ($ext == "jpg") { imagejpeg($img_dst, "", 100); }else if ($ext == "gif") { imagegif($img_dst); }else if ($ext == "png") { imagepng($img_dst); }imagedestroy($img_dst);?>
using my script, the image will show with ?src=image_name&w=image_widththe images are store in /images directory..
this is the example:
real image
resized image