Jump to content

GD Image Problems


cheechm

Recommended Posts

What does the script do? Create a gradient colored text? Plus the script hogs all system resources, CPU usage 100% for awhile, doesn't look too good. Those white bits.. problem with alpha(i.e. transparency) channels probably?

 

I think following code makes text correcly on transparent background without white bits and doesn't hog all system resources either.

<?php
$font="tahoma.ttf";
$col= imagecolorallocate($im, 0,170,0);
$im = imagecreatetruecolor(400, 400);
imagettftext($im, 20,0,400/2,400/2, $col, $font, 'TeXt');

header ("Content-type: image/png");
imagepng($im);
imagedestroy($im); 
?>

Link to comment
https://forums.phpfreaks.com/topic/105177-gd-image-problems/#findComment-538614
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.