imagecreatefromjpeg()関数はファイルが存在しないと言いますが、file_exists()関数を使用してチェックすると、存在すると言います。
PHPコードは次のようなものです
$path = "/home/content/html/uploads/test.jpg";
if(file_exists($path)) {
echo "Exists!";
} else {
echo "File Not Exists!";
}
$resize = new Resize($path, $img['name']);
$resize->resizeImage($size[0], $size[1]);
$resize->preview();
そして、私は次のような出力を得ました、
Exists!
Warning: imagecreatefromjpeg(/home/content/html/uploads/test.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/content/html/includes/resize.php on line 20
ディレクトリ構造、
- / html
- / uploads
- test.jpg
- index.php
- / uploads