dpd66100 2013-05-16 10:55
浏览 78
已采纳

中止readfile时的PHP页面超时

I have an simple php view which looks like this:

header('Content-Type: image/png');
readfile($this->image);
exit();

In this example $this->image is for example /data/pictures/thumbs/x/xyz.png.

On an Index HTML I load about 20 products and display their product image with the code above:

<img src="views/showimage.php?id=100"/>

When I now load the index page with the products, it tooks a short time to load every thumbnail image of the product. If I wait until loading is completed, I can click on each other button on the page and it loads the clicked content. If I dont wait until the page /images are beeing loaded, I can click on each other button and the browser will run into a timeout. After this I have to clean my cookies and can do it again.


EDIT:

I figured out, that its possible to load the page for 2 times, even though I dont let him complete loading. On the third load, and clicking on navigation before page loads completed, it rans into timeout...


This is not an browser problem!

Whos having any idea? PHP Log is empty.

  • 写回答

1条回答 默认 最新

  • duanhan5388 2013-05-16 13:55
    关注

    After discussion we've found the solution.

    Root of problem was in excessive data in images. Each image had dimensions of around 40x27 pixels and size more than 1 Mb.

    Adding stripImage() into part that makes thumbnails stripped away excessive data (which seems to be color profile) and decreased file size to several kb.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 请查询全国几个煤炭大省近十年的煤炭铁路及公路的货物周转量
  • ¥15 请帮我看看我这道c语言题到底漏了哪种情况吧!
  • ¥66 如何制作支付宝扫码跳转到发红包界面
  • ¥15 pnpm 下载element-plus
  • ¥15 解决编写PyDracula时遇到的问题
  • ¥15 有没有人能解决下这个问题吗,本人不会编程
  • ¥15 plotBAPC画图出错
  • ¥30 关于#opencv#的问题:使用大疆无人机拍摄水稻田间图像,拼接成tif图片,用什么方法可以识别并框选出水稻作物行
  • ¥15 Python卡尔曼滤波融合
  • ¥20 iOS绕地区网络检测