Jump to content

problem with imagettftext()


helloise

Recommended Posts

i have this code:

 

$wap_image_filename = $wap_profile_pic."-wap.jpg";
$image =0;
if($mimetype=='IMAGE/PNG')
{
 $image = imagecreatefrompng($profile_pic);
 imagejpeg($image,$wap_image_filename , 100);
}
else if($mimetype=='IMAGE/JPG')
{
$image = imagecreatefromjpeg($profile_pic);
imagejpeg($image,$wap_image_filename , 100);
}

//resize photo with 100% quality
$this->resizeImage($profile_pic,$wap_image_filename,300,300,100);

$filename = $wap_image_filename;
$date_card_image = imagecreatetruecolor(400, 500);
//$date_card_image gives resource id

$bg_col = imagecolorallocate ( $date_card_image, 200, 200, 200 );
imagefill ( $date_card_image, 0, 0, $bg_col);

$source = imagecreatefromjpeg($filename);
//$source gives a resource id#

list($ppwidth, $ppheight) = getimagesize($filename);

// Resize
imagecopyresized($date_card_image, $source , 0, 40, 0,0, 400,  $ppheight, $ppwidth, $ppheight);

$uc_color 		= ImageColorAllocate ($date_card_image,10, 10, 10);
$info_color 	= ImageColorAllocate ($date_card_image,42, 134, 186);

$white = imagecolorallocate($date_card_image, 255, 255, 255);
$black = imagecolorallocate($date_card_image, 0, 0, 0);
$blue = imagecolorallocate($date_card_image, 0, 0, 128);
$font = '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-Bold.ttf';
$text = $this->getUniqueCode();

// Add the text
imagettftext($date_card_image, 24, 0, 55, 30, $blue, $font, $text);    [color="Red"]//get warning on this line 227[/color]

 

the warning i get is:

Warning: imagettftext(): Could not find/open font in /home/helloises/traffic_2/phoenix/plugins/rainbowCodePlugin/lib/model/RcProfileTable.php on line 227

 

please can some one help me fix this?

thank you

Link to comment
https://forums.phpfreaks.com/topic/232381-problem-with-imagettftext/
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.