PDA

View Full Version : GD problem in PHP


megahard
Mon 8th Dec '03, 8:49am
for some reason:


function display_counter_as_image()
{

if( $this->error == '' ){

// Make an image 100x20
$im = imagecreate(100, 20);

// Make the headers PNG
header('Content-type: image/png');

// Make the colors
$this->bgcolors = $this->hex2int( $this->userinfo->bgcolor );
$this->bgcolor = imagecolorallocate( $im, $this->bgcolors['r'], $this->bgcolors['g'], $this->bgcolors['b'] );

$this->fontcolors = $this->hex2int( $this->userinfo->fontcolor );
$this->fontcolor = imagecolorallocate( $im, $this->fontcolors['r'], $this->fontcolors['g'], $this->fontcolors['b'] );


/////////////////////////////////////////////////////////// This Line //////////////////
imagecopymerge( $im, './small_images/counter_logo.gif', 0, 0, 0, 0, 23, 7, 0 );
//////////////////////////////////////////////////////////////////////////////////

imagettftext ( $im, 10, 0, 32, 15, $this->fontcolor, './verdana.ttf', $this->userinfo->hits);

imagepng( $im );

imagedestroy($im);

}

}


everything works apart from the line highlighted

what am I doing wrong?

I want a little logo 23x7 to appear on the left of the image being created

Symen_4ab
Thu 11th Dec '03, 3:45pm
What do you mean by "this line doesn't work" ?
Any php errors ? That would help a lot ;)

megahard
Sun 14th Dec '03, 11:29am
doesnt matter, its becoz i didnt load the image into memory

PHP errors aren't plentiful when creating images:rolleyes: