Hi, I have tried that function before and it has never worked for me. I set the headers, I set the function correctly, I display it correctly with imagejpeg(), but all it does is display the URL of the current page in HTML text. Here's what I have:
header("Content-type: image/jpeg");
$new_width = 300;
$new_height = 150;
$n_image = imagecreatetruecolor($new_width, $new_height);
$o_image = imagecreatefromjpeg("image.jpg");
list($width, $height) = getimagesize($o_image);
imagecopyresampled($n_image, $o_image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($n_image);
imagedestroy($n_image);
imagedestroy($o_image);
What I'm trying to do is, no matter the size, cut the image off to 300x150 without shrinking or stretching the image, just cutting it. I have GD installed, everything is up to date, that's not a prob cause I've been working with PHP GD for about 8 months. Thanks. (NOTE: I have also tried it without the image destroys, and one time with imagejpeg($n_image, null, 100); like shown on php.net with no luck)