[eluser]EugeneS[/eluser]
ok here is code i use:
Code:
$this->load->library('image_lib');
// START Image resizing
$config['source_image'] = $this->dir_to_upload.$this->file_name;
$config['quality'] = '100%';
$config['width'] = '80';
$config['height'] = '80';
$config['create_thumb'] = true;
// END Image resizing
$this->image_lib->initialize($config);
$this->image_lib->resize();
// START watermarking the image
$config['source_image'] = $this->dir_to_upload.$this->file_name;
$config['create_thumb'] = false;
$config['wm_type'] = 'overlay';
$config['wm_overlay_path'] = $this->dir_to_upload.'../watermark.gif';
$config['wm_vrt_alignment'] = 'bottom';
$config['wm_hor_alignment'] = 'right';
// END watermarking the image
$this->image_lib->initialize($config);
$this->image_lib->watermark();
without
$config['create_thumb'] = false; in the watermarking config it:
1) removes previously created thumb
2) it keep initial big image NOT watermarked
3) it creates fullsize image with the postfix
_thumb and watermark it
it seems to me that Initialize method do not reset some internal variables inside the class after the previous operation.
PS: it doesnt matter if for watermarking i rename $config to $config_wm (i just expect this proposal from you guys
)
first my try was (and supposed to work correct but it doesnt)
Code:
$this->load->library('image_lib');
// START Image resizing
$config['source_image'] = $this->dir_to_upload.$this->file_name;
$config['quality'] = '100%';
$config['width'] = '80';
$config['height'] = '80';
$config['create_thumb'] = true;
// END Image resizing
// START watermarking the image
$config['wm_type'] = 'overlay';
$config['wm_overlay_path'] = $this->dir_to_upload.'../watermark.gif';
$config['wm_vrt_alignment'] = 'bottom';
$config['wm_hor_alignment'] = 'right';
// END watermarking the image
$this->image_lib->initialize($config);
$this->image_lib->resize();
$this->image_lib->watermark();