[email protected] Posted September 16, 2008 Share Posted September 16, 2008 Hi, I'm using this code to create an image: // create a blank image $image = imagecreatetruecolor(400, 300); $grey = imagecolorallocate($image, 200, 200, 200); // fill the background color $xyz = imagefill($image, 0, 0, $grey); $xyz = imagecolortransparent($image, $grey); (...) <--generate some content, which displays properly // output the picture imagetruecolortopalette($image, true, 256); Imagejpeg($image, "myimage.jpg"); One one server (Apache, linux) the background always remains black; on other servers the same code generates nice gray background. How can I fix this ? Link to comment https://forums.phpfreaks.com/topic/124457-always-black-background-on-generated-images/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 16, 2008 Share Posted September 16, 2008 Some of the functions require GD2 and are likely generating errors. Add the following two lines after your first <?php tag - ini_set ("display_errors", "1"); error_reporting(E_ALL); Link to comment https://forums.phpfreaks.com/topic/124457-always-black-background-on-generated-images/#findComment-642706 Share on other sites More sharing options...
al3x8730 Posted September 16, 2008 Share Posted September 16, 2008 http://us.php.net/manual/en/function.imagestring.php Link to comment https://forums.phpfreaks.com/topic/124457-always-black-background-on-generated-images/#findComment-642710 Share on other sites More sharing options...
[email protected] Posted September 16, 2008 Author Share Posted September 16, 2008 No errors pop up on this one...How can I find out what version of GD I'm using on each server ? Link to comment https://forums.phpfreaks.com/topic/124457-always-black-background-on-generated-images/#findComment-642732 Share on other sites More sharing options...
JasonLewis Posted September 16, 2008 Share Posted September 16, 2008 Make a php document with this: <?php phpinfo(); ?> Then do a search for "GD Version". Link to comment https://forums.phpfreaks.com/topic/124457-always-black-background-on-generated-images/#findComment-642825 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.