このエラーの原因は何ですか?
致命的なエラー: 5 行目の /var/www/polaroid.php の未定義関数 imagefilter() の呼び出し
1 <?PHP
2 $img_addr = $_GET['image_address'];
3 $img = imagecreatefromjpeg($img_addr);
4
/* everything works as expected without this line */
5 imagefilter($img, IMG_FILTER_GRAYSCALE);
6
7 if ($img)
8 {
/* I moved the header function here so I can see errors in the browser.
If I leave it at the top of the file, the browser expects an image
and doesn't print the error messages. */
9 header('Content-type: image/jpeg');
10 imagejpeg($img);
11 }
12 ?>
13
これは私が使用する URL です。
http://localhost/polaroid.php?image_address=http://mattnelsoninfo.files.wordpress.com/2008/04/ceiling_cat1.jpg
注: gd は phpinfo() からの出力にリストされます。
編集: PHP バージョン 5.2.6-2ubuntu4.1 を使用しています
別の編集:
phpinfo() は gd セクションでこれを生成します
gd
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.3.7
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
ありがとう!