= $thumb_aspect ) { $new_height = $thumb_height; $new_width = $width / ($height / $thumb_height); } else { $new_width = $thumb_width; $new_height = $height / ($width / $thumb_width); } $thumb = imagecreatetruecolor( $thumb_width, $thumb_height ); imagecopyresized($thumb, $image, 0 - ($new_width - $thumb_width) / 2, 0 - ($new_height - $thumb_height) / 2, 0, 0, $new_width, $new_height, $width, $height); imagejpeg($thumb,null,100);