Hello I am working over a Facebook app that’s requires retrieving users display picture and merge it with another image, the problem is I am using heroku which does not provide GD support for jpeg images, hence I can’t work it out while the image format is jpeg.
- I need suggestions to work out this problem of mine somehow.
- Is it possible that i include support for jpeg by including some library in
my project and referencing in my code.
This is what I am getting while the input image is 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)
}
Apparently Heroku does support ImageMagick on PHP, which you can use instead of GD for JPEG image processing. Not very useful for existing apps, but if you’re starting from scratch it shouldn’t be an issue.