How do you resize an image with PHP?

you can use either php gdlib module (simple) or imagemagick (better results, i think) the code is pretty simple: (If you choose to use gdlib): $img_width = 400;$img_height=300; $img_src = imagecreatefromjpeg($file); $img_thumb=imagecreatetruecolor($img_width,$img_height); imagecopyresampled($img_thumb, $img_src,0,0,0,0,$img_width, $img_height, imagesx ($img_src), imagesy($img_src)); header ("Content-type: image/jpeg"); imagejpeg($img_thumb, "", 60); imagedestroy ($img_thumb); (If you choose to use imagemagick): $resource = NewMagickWand(); $result = MagickReadImage( $resource, $file ); MagickResizeImage( $resource, $new_width, $new_height, MW_BesselFilter, 1 ); MagickSetCompressionQuality($resource, 0.76); MagickSetImageFormat($resource, 'jpg'); MagickWriteImage( $resource, $new_file ); ClearMagickWand($resource);