I run a virtual pet website and we use the PHP GD Library to produce our Avatars and Pets. We have over a thousand users so far, and out of that only 3 users have had this issue. 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.
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);
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. After doing so, all images loaded fine.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.