I am trying to teach myself PHP and I have run through a few tutorial and set myself a project. I am now stuck. I am trying to get PHP to generate thumnails for all my pictures, which are all in directories, and displaythem onto an HTML web page. I am running into a lot of issues with headers. I am sure this must be a fairly simple thing to do. All my pictures are jpgs and are in the directory the PHP is running in. Most of my tries have been cut and pasted examples. Any ideas or points in the right direction would be much Apprenticed. Here is one of my attempts: <?php ob_start(); ?> <html> <body> <br>Start of HTML.<br> <?php // Content type header('Content-type: image/jpeg'); //echo "<br>$image<br>"; //$filename = $image; $filename = "test.jpg"; $percent = 0.5; // Get new sizes list($width, $height) = getimagesize($filename); $newwidth = 150; $newheight = 150; // Load $thumb = imagecreatetruecolor($newwidth, $newheight); $filename = imagecreatefromjpeg($filename); // Resize imagecopyresized($thumb, $filename, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Output imagejpeg($thumb); //return $thumb; ob_end_flush(); ?>