ユーザーのプロフィール写真を別の画像に配置したいので、次のコードでユーザーのプロフィール写真を取得してみました
$url='https://graph.facebook.com/'.$uid.'/picture?type=large';
$userpic = imagecreatefromjpeg($url);
imagejpeg($userpic, "xyz.jpg", 100);
しかし、私はこのエラーが発生しています:
imagecreatefromjpeg() [function.imagecreatefromjpeg]: Cannot read image data in /home/a3111484/public_html/fb/index.php
私も試しfile_get_contents()
ましたが、その場合は空のjpgファイルが作成されます。
問題を理解するのを手伝ってください。
cURL の方法も試しましたが、次のエラーが発生しました。
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /home/a3111484/public_html/fb/index.php on line 31