[eluser]omed habib[/eluser]
I'm trying to use the image class to watermark an image. I have the GD library installed on the system (version 2.0.28) and am using the following code:
Code:
$this->load->library('image_lib');
$config['image_library'] = 'GD2';
$config['source_image'] = SITE_ROOT.INVENTORYIMAGES.$pk_inventory_id.'/'.$filename;
$config['wm_text'] = 'Copyright 2006 - John Doe';
$config['wm_type'] = 'text';
$config['wm_font_path'] = './system/fonts/texb.ttf';
$config['wm_font_size'] = '35';
$config['wm_font_color'] = '000000';
$config['wm_vrt_alignment'] = 'bottom';
$config['wm_hor_alignment'] = 'center';
$config['wm_padding'] = '20';
$this->image_lib->initialize($config);
$this->image_lib->watermark();
The above code produces the following error message:
Quote:A PHP Error was encountered
Severity: Warning
Message: imagettftext() [function.imagettftext]: Could not read font
Filename: libraries/Image_lib.php
Line Number: 1077
If I comment out the wm_font_path, the error disappears, but it still doesn't work. I also tried to echo $this->image_lib->display_errors();, but to not avail :\
Any ideas anyone?