Here is some code for resizing images. It comes from a program I wrote to automatically create galleries from a folder of images. Definately works for jpg. But I saved the thumbnails to my servers harddrive - you could ignore that part and use the imagedestroy function after you've displayed it. Hope this helps.if ($type == "jpg" || $type == "jpeg" || $type == "JPG" || $type == "JPEG"){ $img_source = imagecreatefromjpeg($this->path.$imagename); $oldWidth = imagesx($img_source); $oldHeight = imagesy($img_source); $newHeight = ($newWidth/$oldWidth)*$oldHeight; $img_destination = imagecreatetruecolor($newWidth,$newHeight); imagecopyresized($img_destination,$img_source,0,0,0,0,$newWidth,$newHeight,$oldWidth,$oldHeight); imagejpeg($img_destination,$this->options->thumb_path . "thumb" . $imagename,100); return $this->options->thumb_path . "thumb" . $imagename;}elseif ($type == "gif" || $type == "GIF"){ $img_source = imagecreatefromgif($this->path.$imagename); $oldWidth = imagesx($img_source); $oldHeight = imagesy($img_source); $newHeight = intval((doubleval($newWidth)/doubleval($oldWidth))*$oldHeight); $img_destination = imagecreate($newWidth,$newHeight); imagecopyresized($img_destination,$img_source,0,0,0,0,$newWidth,$newHeight,$oldWidth,$oldHeight); imagegif($img_destination,$this->options->thumb_path . "thumb" . $imagename); return $this->options->thumb_path . "thumb" . $imagename;}elseif ($type == "png" || $type == "PNG"){ $img_source = imagecreatefrompng($this->path.$imagename); $oldWidth = imagesx($img_source); $oldHeight = imagesy($img_source); $newHeight = intval((doubleval($newWidth)/doubleval($oldWidth))*$oldHeight); $img_destination = imagecreate($newWidth,$newHeight); imagecopyresized($img_destination,$img_source,0,0,0,0,$newWidth,$newHeight,$oldWidth,$oldHeight); imagepng($img_destination,$this->options->thumb_path . "thumb" . $imagename); return $this->options->thumb_path . "thumb" . $imagename;}