<?php
 
  //  this code fails on my system.  It returns "<html><body></body></html>" 
  //  see http://sarahandjeremy.net/~jbf/eg/php/jpegDemo?thumbnail=1 

  $source= "waterfall.jpg";

    $width=64;
    $height= 64;


		if(!($sourceImage = @imagecreatefromjpeg($source))) {
      print "read of image failed";
      exit();
		} 


		$destinationImage = imagecreatetruecolor($width, $height);

		imagecopyresampled($destinationImage, $sourceImage,
			0, 0, 0, 0, $width, $height,
		imagesx($sourceImage), imagesy($sourceImage));

    header("Content-type: image/jpg" );

    imagejpeg($destinationImage,'',90);

?>
