I have a directory of jpegs that I want to display thumbnails of and have a link to the original jpeg. I would rather not create separate thumbnails images preferring to create them in memory to display them. I have installed GD v.1.8.4. The code below outputs jumbled text to the browser (possibly the jpeg stream?). Code is as follows:
</tr> <td><img alt="text" src="<?php echo CreateThumbnail(); ?>" valign="top" /></td> </tr> <?php function CreateThumbnail() { $x = 130; $y = 100; $quality = 75; $thumbnail = imagecreate($x, $y); $originalimage = imagecreatefromjpeg('test.jpg'); imagecopyresized($thumbnail, $originalimage, 0, 0, 0, 0, $x, $y, ImageSX($originalimage),ImageSY($originalimage)); header("Content-Type: image/jpeg"); imagejpeg($thumbnail,'test.jpg',$quality); imagedestroy($thumbnail); } ?> Why will this not work? **************************************************** This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. **************************************************** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php