douke9379 2015-10-01 06:22
浏览 60

PHP缩略图生成器不处理缩略图

I am using a PHP Thumbnail Generating script that I have used without issue many times in the past. I am currently using it without issue on the very same domain that I am now having problems. The script is processing to a point. It is generating physical thumbnail images and saving them into the preset cache directory but it is not returning resized images to the browser. The image src is in the following format:

<img src="thumbnail.php?file=sample/02.jpg&w=100&h=70&el=0&gd=0" />

I have confirmed that the image exists and can be displayed in a browser itself. Also, the PHP script loads ok as I have tested it by adding an 'echo' to confirm. I have installed this script in multiple locations on the server and the result is the same. I have even tried other versions of PHP Thumbnail Generators and none of them produce resized images in the browsers.

I have checked that GD is active on my server:

GD Support          enabled
GD Version          bundled (2.1.0 compatible)
FreeType Support    enabled
FreeType Linkage    with freetype
FreeType Version    2.4.2
GIF Read Support    enabled
GIF Create Support  enabled
JPEG Support        enabled
libJPEG Version     6b
PNG Support         enabled
libPNG Version      1.2.44
WBMP Support        enabled
XBM Support         enabled

PHP is version 5.3.29

Imagemagick is available and path confirmed as '/usr/bin/convert/'.

Here you see the result:

http://demos.mitey.co.nz/image_processor/index.php

All that appears is broken image placeholders instead of the dynamically generated thumbnails. All relevant permissions have be set to 0777 or 0755, tried both. This really isn't a difficult script to use and I have numerous times in the past but I am unable to debug whatever is causing it to fail in this instance.

Anybody have any ideas as to what could be stopping the image source from correctly processing the PHP contained within it? I have tried so many different things that I can no longer focus on the issue and come up with anything else to try.

  • 写回答

2条回答 默认 最新

  • dongxi4335 2015-10-01 06:56
    关注

    Download the latest PHPthumb from website For generate thumb see documentation

    don't forget to Change variable as per your need.

    $thumbUrl = "somefolder/new.jpg";
    $resizeWidth = "70"; // in pixels
    $resizeHeight = "70"; // in pixels
    
    $imageThumb = $directoryPath. "/phpThumb/phpThumb.php?src=" . $thumb1 . "&amp;w=".$resizeWidth."&amp;h=".$resizeHeight."&amp;iar=1&amp;hash=90e9d46c4d138a72574c52e31fbef0dc";
    
    echo '<img src="'.$imageThumb.'" alt="filename.jpg" />';
    
    评论

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型