bhavin12300 Posted December 22, 2009 Share Posted December 22, 2009 hi i have one simple code which add transparent color to image and save it as ".png". it works fine on my local computer using WAMP. but when i ran same code on server it generate no output image. my php version is 5.3 and server php versoin is 5.2 here is my code <?php $info = getimagesize("rose.jpeg"); $width = $info[0]; $height = $info[1]; $im = imagecreatetruecolor($width, $height); $image = @imagecreatefromjpeg("rose.jpeg"); $black = imagecolorallocate($im, 255, 255, 255); imagecolortransparent($im, $black); imagecopy($im, $image, 0, 0,0 ,0,$width, $height); imagepng($im, 'output.png'); imagedestroy($im); ?> can you let me know why whats reason? how can i make it run on server?/ Link to comment https://forums.phpfreaks.com/topic/186044-imagecolortransparent-problem/ Share on other sites More sharing options...
bhavin12300 Posted December 23, 2009 Author Share Posted December 23, 2009 please any one , any idea. Link to comment https://forums.phpfreaks.com/topic/186044-imagecolortransparent-problem/#findComment-982843 Share on other sites More sharing options...
rajivgonsalves Posted December 23, 2009 Share Posted December 23, 2009 does the script show any errors, the GD library must not be installed put this at the very start of your script error_reporting(E_ALL); ini_set('display_errors', '1'); Link to comment https://forums.phpfreaks.com/topic/186044-imagecolortransparent-problem/#findComment-982845 Share on other sites More sharing options...
bhavin12300 Posted December 23, 2009 Author Share Posted December 23, 2009 first thanks for your reply rajivgonsalves. i added your two lines. i got error. GD was not insalled on server. after installing GD all well. thanks you so much. Link to comment https://forums.phpfreaks.com/topic/186044-imagecolortransparent-problem/#findComment-982886 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.