}
}
//图像旋转
function
rotate(){
$config
['image_library'] = 'gd2';
//(必须)设置图像库
$config
['source_image'] = 'ptjsite/upload/001.jpg';
//(必须)设置原始图像的名字/路径
$config
['dynamic_output'] = FALSE;
//决定新图像的生成是要写入硬盘还是动态的存在
$config
['quality'] = '90%';
//设置图像的品质。品质越高,图像文件越大
$config
['new_image'] = 'ptjsite/upload/rotate001.jpg';
//设置图像的目标名/路径
$config
['rotation_angle'] = 'vrt';
//有 5
个旋转选项 逆时针 90 180 270
度 vrt
竖向翻转 hor 横向
翻转
$this
->image_lib->initialize(
$config
);
if
( !
$this
->image_lib->rotate())
{
echo
$this
->image_lib->display_errors();
}
}
//文字水印
function
watermark(){
$config
['image_library'] = 'gd2';
//(必须)设置图像库
$config
['source_image'] = 'ptjsite/upload/003.jpg';
//(必须)设置原图像的名字和路径. 路径必须
是相对或绝对路径,但不能是 URL.
$config
['dynamic_output'] = FALSE;
//TRUE 动态的存在(直接向浏览器中以输出图
像),FALSE 写入硬盘
$config
['quality'] = '90%';
//设置图像的品质。品质越高,图像文件越大
$config
['new_image'] = 'ptjsite/upload/crop004.gif';
//设置图像的目标名/路径。
$config
['wm_type'] = 'overlay';
//(必须)设置想要使用的水印处理类型(text, overlay)
$config
['wm_padding'] = '5';
//图像相对位置(单位像素)
$config
['wm_vrt_alignment'] = 'middle';
//
竖轴位置 top, middle, bottom
$config
['wm_hor_alignment'] = 'center';
//
横轴位置 left, center, right
$config
['wm_vrt_offset'] = '0';
//指定一个垂直偏移量(以像素为单位)
$config
['wm_hor_offset'] = '0';
//指定一个横向偏移量(以像素为单位)
/*
文字水印参数设置 */
$config
['wm_text'] = 'Copyright 2008 - John Doe';
//(必须)水印的文字内容
$config
['wm_font_path'] = 'ptj_system/fonts/type-ra.ttf';
//字体名字和路径
$config
['wm_font_size'] = '16';
//(必须)文字大小