CodeIgniter Forums

Full Version: Image lib - Problems watermarking orig and creating thumb copy
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]the real rlee[/eluser]
Hi guys,

been working with the Image library, pretty good stuff but im so confused on how to watermark an image then create a thumb copy of this image. For some reason it never watermarks the source image and just resizes the source image to the thumbsize!

Here's what i have (simplified for the post):

Code:
// main (original)
$main_image['source_image'] = './uploads/myimage.jpg';
$main_image['image_library'] = 'GD2';
$main_image['wm_text'] = 'newsXpress';
$main_image['wm_type'] = 'text';
$main_image['wm_font_path'] = BASEPATH.'fonts/arial.ttf';
$main_image['wm_font_size'] = '9';
$main_image['wm_font_color'] = 'CC2228';
$main_image['wm_opacity'] = 100;
$main_image['wm_vrt_alignment'] = 'bottom';
$main_image['wm_hor_alignment'] = 'right';
$main_image['wm_vrt_offset'] = 2;
$main_image['wm_padding'] = '2';
$this->image_lib->initialize($main_image);
$this->image_lib->watermark();

// thumbnail
$thumb_image['source_image'] = './uploads/myimage.jpg';
$thumb_image['image_library'] = 'GD2';
$thumb_image['create_thumb'] = TRUE; // assume this will create a thumb copy of orig???
$thumb_image['width'] = 92;
$thumb_size['height'] = 124;
$this->image_lib->initialize($thumb_image);
$this->image_lib->resize();