Hey Jaydee,
It looks like you are first creating a blank image called "new.jpg" and then creating another image "1.jpg" from an existing "1.jpg"?
If ImageJPEG works like ImageGIF, then putting a file name in the second parameter writes the file to disk rather than out the browser. This seems contrary to your intent as illustrated by the header type you set (image/jpeg).
If you want to generate a thumbnail onto another image on the fly (not saving it to disk) and output directly to the browser, use the ImageCopyResized() function and code like in the following example:
<?php
Header("Content-Type: image/gif");
// create an image object from the existing gif file
$imIn = $ImageCreatefromGIF("imageIn.gif");
// get size of original image
$size = GetImageSize("imageIn.gif");
// calculate size for new image canvas (double, for example)
$imOutWidth = $size[0] 2;
$imOutHeight = $size[1] 2;
// calculate centering coordinates for new image
$centerX = ($imOutWidth / 2) - ($size[0] / 2);
$centerY = ($imOutHeight / 2) - ($size[1] / 2);
// create the blank canvas
$imOut = ImageCreate($imOutWidth, $imOutHeight);
$black = ImageColorAllocate($imOut, 0, 0, 0);
ImageFill($imOut, 10, 10, $black);
// copy the original image to the bigger pallet (centered)
ImageCopyResized($imOut, $imIn, $centerX, $centerY, 0, 0, $size[0], $size[1], $size[0], $size[1]);
// output the image to the browser and destroy it
ImageGif($imOut);
ImageDestroy($imIn);
ImageDestroy($imOut);
?>
-- Rich --