Ok, I'm trying to make an image grayscale. I got that to work. Now I want to save the image in a directory and NOT display it on the screen. The code below works but it also outputs an empty image box on the screen:
header ('Content-type: image/jpeg');
$img_locate ="some_image.jpg";
// Load the target image
$rDestImg = imagecreatefromjpeg($img_locate);
// Create a blank source image
$rSourceImg = ImageCreate (0,0);
// Merge the source with the destination
ImageCopyMergeGray ($rDestImg, $rSourceImg, 0, 0, 0, 0, imageSX($rDestImg), imageSY($rDestImg), 0);
// Save new image to server
Imagejpeg($rDestImg, "some_location/newname.jpg");
The last line is the one I'm having problems with. It saves the file but I don't want any output on the screen.
Any ideas?