<?
$filename = 'anyimage.jpg';
$percent = 0.5;
// Content type
header('Content-type: image/jpeg');
// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = $width $percent;
$newheight = $height $percent;
// Load
$thumb = imagecreate($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
imagejpeg($thumb);
?>
this is the code and prints binary form of the image on the page. i will be glad if you try this, and if works properly please send me the configuration you use.