在 php 获取图片尺寸的方法我们可以使用 getimagesize 获取图片尺寸的效率是很低的,首先需要获取整个的图片信息,然后再进行操作,下面的例子更科学算法更好,我们一起来看看吧。
下方法可以用于快速获取图片尺寸信息
1.获取jpeg格式图片的尺寸信息
2.
$url='http://www.phprm.com /images/201203/08/1331189004_28093400.jpg';$image_content = file_get_contents($url);$image = imagecreatefromstring($image_content);$width = imagesx($image);$height = imagesy($image);echo $width.'*'.$height.nr;
文章网址:
随意转载^^但请附上教程地址。