Dusaro Posted May 11, 2012 Share Posted May 11, 2012 Well, I have been tryna figure this out for days but it wont seem to work. The base image appears fine but it wont write the text or the avatar on it. <?php //Do Not Cache header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); //Getting Variables $user = "Dusaro"; $rank = "Administrator"; $a = "0"; if(isset($_GET['a'])) { if(!empty($_GET['a'])) { $a = $_GET['a']; } } if(isset($_GET['u'])) { if(!empty($_GET['u'])) { $user = $_GET['u']; } } if(isset($_GET['r'])) { if(!empty($_GET['r'])) { $rnk = $_GET['r']; } else{$rnk='Administrator';} } else{$rnk='Administrator';} if(isset($_POST['u'],$_POST['r'],$_POST['a'])) { if(!empty($_POST['u'])) { $user=$_POST['u']; } if(!empty($_POST['r'])) { $rnk = $_POST['r']; } if(!empty($_POST['a'])) { $a = $_POST['a']; } } //Setting up Image $image = imagecreatefrompng("base.png"); $avatar = imagecreatefrompng($a.".png"); $font = "US101.TTF"; imagecopymerge($image, $avatar, 0, 0, 0, 0, 100, 100, 100); $color = imagecolorallocate($image, 0,0,0); ImageTTFText ($image, "15", 0, 230, 0, $color, $font,$user); ImageTTFText ($image, "14", 0, 257, 96, $color,$font,$rnk); //Displaying Image header("Content-type: image/png"); imagepng($image); imagedestroy($image); imagedestroy($avatar); ?> can any1 help? Quote Link to comment https://forums.phpfreaks.com/topic/262389-image-generation-imagecopymergeimagettftext/ Share on other sites More sharing options...
Barand Posted May 11, 2012 Share Posted May 11, 2012 have you tried commenting out the header() to see if any errormessages? Quote Link to comment https://forums.phpfreaks.com/topic/262389-image-generation-imagecopymergeimagettftext/#findComment-1344717 Share on other sites More sharing options...
Dusaro Posted May 11, 2012 Author Share Posted May 11, 2012 I didn't know i was using a header to stop it displaying errors? Quote Link to comment https://forums.phpfreaks.com/topic/262389-image-generation-imagecopymergeimagettftext/#findComment-1344734 Share on other sites More sharing options...
Dusaro Posted May 12, 2012 Author Share Posted May 12, 2012 Bump? Quote Link to comment https://forums.phpfreaks.com/topic/262389-image-generation-imagecopymergeimagettftext/#findComment-1345052 Share on other sites More sharing options...
.josh Posted May 12, 2012 Share Posted May 12, 2012 have you tried commenting out the header() to see if any errormessages? at the bottom of your script you have a header() call.. comment it out and run your script... do you see any errors displayed? Quote Link to comment https://forums.phpfreaks.com/topic/262389-image-generation-imagecopymergeimagettftext/#findComment-1345054 Share on other sites More sharing options...
Dusaro Posted May 13, 2012 Author Share Posted May 13, 2012 No, it does not show any errors. Quote Link to comment https://forums.phpfreaks.com/topic/262389-image-generation-imagecopymergeimagettftext/#findComment-1345063 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.