您好我正在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