您好我正在Facebook應用程序需要檢索用戶顯示圖片並將其與另一個圖像合併,問題是我使用heroku
它不提供GD支持對於JPEG圖像,因此我不能解決它的圖像格式是JPEG格式。不支持GD,任何其他方式來轉換JPEG圖像
- 我需要一些建議來解決我的這個問題。
- 是否有可能通過在我的項目中包含一些庫並在我的代碼中引用某個庫來支持jpeg。
這是我得到的同時輸入圖像是JPEG:
Warning: imagecreatefromstring(): Data is not in a recognized format in …
Warning: imagegif() expects parameter 1 to be resource, boolean given in…
$dpImageGif = 'temp/'. $userId '.gif';
$url = file_get_contents("http://graph.facebook.com/{$userId}/picture?type=large");
$dpImage = 'temp/' . $userId ;
$imageObject = imagecreatefromstring($url);
//$imageObject = imagecreatefromjpeg($dpImage);
imagegif($imageObject, $dpImageGif);
gd_info():
array(11) {
["GD Version"]=>
string(27) "bundled (2.0.34 compatible)"
["FreeType Support"]=>
bool(false)
["T1Lib Support"]=>
bool(false)
["GIF Read Support"]=>
bool(true)
["GIF Create Support"]=>
bool(true)
["JPEG Support"]=>
bool(false)
["PNG Support"]=>
bool(true)
["WBMP Support"]=>
bool(true)
["XPM Support"]=>
bool(false)
["XBM Support"]=>
bool(true)
["JIS-mapped Japanese Font Support"]=>
bool(false)
}
呃什麼樣的PHP構建不會支持JPEG ...?你有沒有試過看到什麼是甚至包含在$ url? – dqhendricks 2012-03-24 21:34:17
可能dublicate:http://stackoverflow.com/questions/8627701/lack-of-heroku-php-gd-setup-for-jpeg-files-causing-issues – 2012-03-24 21:40:24