views:

17

answers:

2

I am trying to create a thumbnail of a watermarked image, but can't get it to work. The script always seems to resize the original watermarked image without making the thumbnail.. anyway to accomplish both?

A: 

In the image manipulation class (user guide): http://codeigniter.com/user_guide/libraries/image_lib.html

I need to make several sizes of thumbnails in my application, so instead of using the built in thumbnail functionality I just use:

$this->image_lib->clear();

And then use the resize command.

Matthew
A: 

Here is my code

$config = array();
            $config['source_image'] = $data['json']->{'file_path'};
            $config['new_image'] = 'copy_' . $data['json']->{'file_path'};
            $config['image_library'] = 'gd2';
            $config['wm_type'] = 'overlay';
            $config['wm_overlay_path'] = getcwd() . '/design/new_transparency.png';
            $config['wm_vrt_alignment'] = 'bottom';
            $config['wm_hor_alignment'] = 'center';
            $config['wm_vrt_offset'] = 20;
            $config['create_thumb'] = TRUE;
            $config['maintain_ratio'] = TRUE;
            $config['width'] = 125;
            $config['height'] = 125;
            $this->image_lib->initialize($config);
            $this->image_lib->watermark();
            $this->image_lib->clear();
            $this->image_lib->resize();

is there something I am doing wrong?

dennismonsewicz