CodeIgniter Forums
Watermark and Thumbnail - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Watermark and Thumbnail (/showthread.php?tid=31728)



Watermark and Thumbnail - El Forum - 06-29-2010

[eluser]dennismonsewicz[/eluser]
I am have a script that I need to create a thumbnail and a watermark (on the original image), but my script is only creating the thumbnail and skipping over the watermarking part... any ideas?

Code:
$image = $data['json']->{'file_name'};
            $ext = $data['json']->{'file_ext'};
            $data['account'] = $account;
            
            $this->_insertintodb($account, $image);
            
            //Settings to create thumbnail
            $config['source_image'] = $data['json']->{'file_path'};
            $config['create_thumb'] = TRUE;
            $config['maintain_ratio'] = TRUE;
            $config['width'] = 125;
            $config['height'] = 125;
            $this->image_lib->initialize($config);
            
            if($this->image_lib->resize()) {
                $prep_thumb = explode('.', $image);
                $thumb = $prep_thumb[0] . '_thumb.' . $prep_thumb[1];
                $this->_moveimage($thumb, $account, TRUE);
            }
            
            $this->image_lib->clear();
            
            //Settings to create watermark overlay
            $config = array();
            $config['source_image'] = $data['json']->{'file_path'};
            $config['wm_type'] = 'overlay';
            $config['wm_overlay_path'] = getcwd() . '/design/overlay_watermark_transparent.png';
            $config['wm_vrt_alignment'] = 'middle';
            $config['wm_hor_alignment'] = 'center';
            
            $this->image_lib->initialize($config);
            
            if(!$this->image_lib->watermark()){
                $this->image_lib->display_errors();
            }

Thanks in advance!


Watermark and Thumbnail - El Forum - 06-29-2010

[eluser]dennismonsewicz[/eluser]
Any ideas?


Watermark and Thumbnail - El Forum - 07-29-2010

[eluser]gaben[/eluser]
i have the same problem Sad


Watermark and Thumbnail - El Forum - 07-29-2010

[eluser]dennismonsewicz[/eluser]
Will this help?

http://ellislab.com/forums/viewthread/159487


Watermark and Thumbnail - El Forum - 07-29-2010

[eluser]Mat-Moo[/eluser]
If your not offended by 3rd party libs, try mine out http://ellislab.com/forums/viewthread/161469/ uses GD2 and required php5 though.