nbarone Posted April 6, 2010 Share Posted April 6, 2010 I am trying to load in a PNG image, and place a number on top of it. This code is not outputting anything (not even an error): <?php // define base image $base = ($_GET['hover']=='true')?"/images/assets/sel_hover.png":"/images/assets/sel.png"; // create image $image = imagecreatefrompng($base); // define colors $black = imagecolorallocate($image, 0, 0, 0); // text // define font file $font = "helvetica.ttf"; // define incremental number $num = $_GET['inc']; // define header header ("Content-type: image/png"); // write text to image imagettftext($image,10,0,3,3,$black,$font,$num); // display image imagepng($image); imagedestroy($image); ?> Link to comment https://forums.phpfreaks.com/topic/197774-simple-gd-questionhelp/ Share on other sites More sharing options...
Chris92 Posted April 6, 2010 Share Posted April 6, 2010 $base = (($_GET['hover']=='true')?"/images/assets/sel_hover.png":"/images/assets/sel.png"); Probably no error because the header is an image. Link to comment https://forums.phpfreaks.com/topic/197774-simple-gd-questionhelp/#findComment-1037888 Share on other sites More sharing options...
nbarone Posted April 6, 2010 Author Share Posted April 6, 2010 fixed - source file needed a ".." in front of it. Found error as a PHP Warning in error log. To Chris92... the extra parenthesis are not required, although good practice. Link to comment https://forums.phpfreaks.com/topic/197774-simple-gd-questionhelp/#findComment-1037889 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.