\n"; } else { $img = pg_lo_read_all($ofp); $src = imagecreatefromjpeg($img); list($width, $height) = getimagesize($img); $newwidth = 300; $newheight = ($height/$width) * 300; $tmp = imagecreatetruecolor($newwidth,$newheight); imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); imagejpeg($tmp, NULL, 100); print $tmp; imagedestroy($src); pg_lo_close($tmp); pg_query("END"); } } ?>