在resizeImage这个函数里边
首先利用scale计算出缩放后的宽高,再利用imagecopyresampled函数来处理原图
这是php官方的api
bool imagecopyresampled ( resource $dst_image , resource $src_image , int $dst_x , int $dst_y , int $src_x , int$src_y , int $dst_w , int $dst_h , int $src_w , int $src_h )
将一幅图像中的一块正方形区域拷贝到另一个图像中,平滑地插入像素值,因此,尤其是,减小了图像的大小而仍然保持了极大的清晰度。