Welcome Guest, Not a member yet? Register   Sign In
Watermark
#1

[eluser]Sanity11[/eluser]
Hi all,

I want to upload a image and immediately create a copy with a watermark.

First I want to get the watermarking working:

Code:
function do_upload()
    {
        $data = $this->od_model->general();
        
        $config['upload_path'] = './images/uploads/';
        $config['allowed_types'] = 'gif|jpg|png';
        $config['max_size']    = '200';
        $config['max_width']  = '1024';
        $config['max_height']  = '1280';
        
        $this->load->library('upload', $config);
        
        if ( ! $this->upload->do_upload())
        {
            $upload_info = array('error' => $this->upload->display_errors());
            
            $this->images($upload_info);
        }    
        else
        {    
            $upload_info = array('upload' => $this->upload->data());
            
            $this->od_model->insert_image_data($upload_info['upload']['file_name']);
            
            //Maak na de upload direct de afbeelding met het watermerk aan.
            $this->load->library('image_lib');
            
            $config_wat['source_image'] = $data['uploaded_images_path'] . $upload_info['upload']['file_name'];
            $config_wat['wm_text'] = 'VERKOCHT!';
            $config_wat['wm_type'] = 'text';
            $config_wat['wm_font_path'] = $data['base_system_url'] . 'fonts/texb.ttf';
            $config_wat['wm_font_size'] = '40';
            $config_wat['wm_font_color'] = 'ff0000';
            $config_wat['wm_vrt_alignment'] = 'center';
            $config_wat['wm_hor_alignment'] = 'center';
            $config_wat['wm_padding'] = '20';
            
            $this->image_lib->initialize($config_wat);
            
            $this->image_lib->watermark();
            
            //Als alles klaar is wordt de functie images aageroepen. Deze herlaadt de pagina zodat de updates zichtbaar zijn.
            $this->images($upload_info);
        }
    }

This code makes the image upload perfectly. But there is no watermark..? Can someone help me identify the problem?


Messages In This Thread
Watermark - by El Forum - 06-02-2009, 10:45 AM
Watermark - by El Forum - 06-02-2009, 11:25 AM
Watermark - by El Forum - 06-02-2009, 11:33 AM
Watermark - by El Forum - 06-02-2009, 11:47 AM
Watermark - by El Forum - 06-02-2009, 11:58 AM
Watermark - by El Forum - 06-02-2009, 12:03 PM
Watermark - by El Forum - 06-02-2009, 12:09 PM
Watermark - by El Forum - 06-02-2009, 12:26 PM
Watermark - by El Forum - 06-02-2009, 01:21 PM
Watermark - by El Forum - 06-02-2009, 02:10 PM
Watermark - by El Forum - 06-02-2009, 02:24 PM
Watermark - by El Forum - 09-04-2009, 11:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB