用户
 找回密码
 入住 CI 中国社区
搜索
查看: 10164|回复: 4
收起左侧

[已解决] A PHP Error was encountered

[复制链接]
发表于 2009-7-5 12:13:10 | 显示全部楼层 |阅读模式
A PHP Error was encounteredSeverity: Warning
Message: imagettftext() [function.imagettftext]: Could not read font
Filename: libraries/Image_lib.php
Line Number: 1094

处理图片,添加水印的时候报这个错
在根目录下建了文件夹fonts,建了一个文件texb.ttf
控制器代码

$config['source_image'] = './uploads/guangdong5.jpg';
          $config['wm_text'] = 'Copyright 2006 - John Doe';
          $config['wm_type'] = 'text';
          $config['wm_font_path'] = './fonts/texb.ttf';
          $config['wm_font_size'] = '16';
          $config['wm_font_color'] = 'ffffff';
          $config['wm_vrt_alignment'] = 'bottom';
          $config['wm_hor_alignment'] = 'center';
          $config['wm_padding'] = '20';
          $this->image_lib->initialize($config);
    $this->image_lib->watermark();
    $this->load->view('upload_form',array('images'=> 'guangdong5.jpg') );
发表于 2009-7-5 13:08:29 | 显示全部楼层
貌似是你的 PHP 环境问题,不支持 TTF 字体吧?
发表于 2012-4-6 09:51:03 | 显示全部楼层
A PHP Error was encountered
<p>Severity: Notice</p>
<p>Message:  Undefined variable: row</p>
<p>Filename: libraries/Loader.php(673) : eval()'d code</p>
<p>Line Number: 14</p>
我这个是什么问题呢,查半天了,没有头绪
发表于 2012-4-6 13:21:57 | 显示全部楼层
luckyning 发表于 2012-4-6 09:51
A PHP Error was encountered
Severity: Notice
Message:  Undefined variable: row

贴代码
发表于 2012-4-6 19:24:43 | 显示全部楼层
问题解觉啦,在用foreach时把短标签换成echo表示法就行了

本版积分规则