【发布时间】:2011-11-11 18:56:39
【问题描述】:
我已经为这个问题拍摄了几个小时,我一直在网上寻找解决方案......我在 php 中编写了一个缩略图生成器,它应该生成一个灰度图像和一个非灰度图像,但我一直遇到这个错误。我已经将我的权限更改为 777,并将 chown 更改为nobody 和 admin。只要我用相同的名称重写图像,此功能就可以工作,但由于某种原因它不能存储在文件中。
这是错误:
imagejpeg() [function.imagejpeg]: Unable to open '/Applications/XAMPP/xamppfiles/htdocs/images
/thumb/rollover' for writing: Is a directory
这是我正在使用的代码。
$img = imagecreatefromjpeg($grayscale_path);
imagefilter($img, IMG_FILTER_GRAYSCALE);
imagejpeg($img, realpath($this->gallery_path .'/thumb/rollover/'));
imagedestroy($img);
我也检查了很多次,看看路径是否正确。
【问题讨论】:
标签: php compiler-errors gd thumbnails