getimagesize() 读取不到图片信息

WBOY
Release: 2016-06-23 13:23:28
Original
1532 people have browsed it



电脑浏览器,安卓手机浏览器,苹果微信,都可以正常访问
唯独安卓版微信提示错误,经过输出信息后,发现 $info 是空的,也就是说getimagesize() 获取不到图片信息

//获取图像信息

$info = getimagesize($imgname);

//检测图像合法性
if(false === $info || (IMAGETYPE_GIF === $info[2] && empty($info['bits']))){
throw new Exception('非法图像文件');

}

求各位大神来指导了


回复讨论(解决方案)

$imgname这个的值是什么

$imgname这个的值是什么



这是一个路径 ../imgpublic/ticket_o6ncGuNg1PFOS0cJ403jG30mSCDY.jpg

你总得确认他存在吧?

你总得确认他存在吧?



已经解决 了,他是存在的,不过该文件只有0KB,所以才导致那个出错。。

之所以是0KB是因为下载微信二维码的时候,不用https协议下载,只能是http。

谢谢版主的回答
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!