[英]PHP GD Library Images Not Showing For Some Users
I run a virtual pet website and we use the PHP GD Library to produce our Avatars and Pets. 我经营着一个虚拟宠物网站,我们使用PHP GD库来生产我们的头像和宠物。 We have over a thousand users so far, and out of that only 3 users have had this issue. 到目前为止,我们已有1000多个用户,其中只有3个用户遇到了此问题。 For each user though, it's the exact same issue. 但是对于每个用户来说,这都是完全相同的问题。
Here is a screenshot of what these users see. 这是这些用户看到的屏幕截图 。
The majority of the images just show the "Broken Link" icon, but every once in awhile it starts to build the image and stops before finishing. 大多数图像仅显示“ Broken Link”图标,但偶尔会开始构建图像,并在完成前停止。
These are my attempts at fixing it: 这些是我修复它的尝试:
This is the information I have gathered thus far from these users: 到目前为止,我是从这些用户那里收集的信息:
And lastly, here is the code of the simple test image page I am using: 最后,这是我正在使用的简单测试图像页面的代码:
<?
$finalimage = imagecreatetruecolor(500,500);
$file = 'http://www.somesite.com/picture.jpg';
$layers = imagecreatefromjpeg($file);
imagecopy($finalimage, $layers, 0, 0, 0, 0, 500, 500);
imagedestroy($layers);
header("Content-type: image/jpeg");
imagejpeg($finalimage);
imagedestroy($finalimage);
?>
You have forgot the imagedestroy($finalimage);
您忘记了imagedestroy($finalimage);
at the end, but I don't know if it will solve your problem 最后,但我不知道它是否可以解决您的问题
The issue for our users was using the Kaspersky anti-virus. 我们用户遇到的问题是使用卡巴斯基反病毒软件。 They had to add our URL to the list of trusted sites under web security. 他们必须将我们的URL添加到Web安全下的受信任站点列表中。 After doing so, all images loaded fine. 这样做之后,所有图像都可以正常加载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.