• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
an upload model (upload - resize - watermark) problem it wont resize!!!

#1
[eluser]LDMajor[/eluser]
Code:
function upic($fieldn, $usern, $order=0) {
        $this->load->library('image_lib');
        $pathme=realpath('photos');
        $pathimg=realpath('img');
          // upload
         $config['upload_path'] = $pathme;
        $config['allowed_types'] = 'gif|jpg|png|bmp|jpeg';
        $config['encrypt_name']= TRUE;
        $picin['order']=$order;
        $picin['user']=$usern;
        $this->load->library('upload', $config);
        if ( ! $this->upload->do_upload($fieldn)) {
        //    die ($this->upload->display_errors());
        } else {
            $picin['name']=$this->upload->getme();
            $this->db->insert('pics', $picin);
            $config['width'] = 370;
            $resize_config['source_image'] = $pathme."/".$picin['name'];
            $resize_config['width'] = 370;
            $resize_config['maintain_ratio']=TRUE;
            $this->load->library('image_lib', $resize_config);
            // RESIZE
            $resize_config['source_image'] = $pathme."/".$picin['name'];
            $resize_config['width'] = 370;
            $resize_config['maintain_ratio']=TRUE;
            $this->image_lib->initialize($resize_config);
            $this->image_lib->resize();
            // END RESIZE
            // WM
            $wm_config['source_image'] = $pathme."/".$picin['name'];
            $wm_config['wm_type'] = 'overlay';
            $wm_config['quality']='100';
            $wm_config['padding']='2';
            $wm_config['wm_vrt_alignment']='bottom';
            $wm_config['wm_hor_alignment']='right';
            $wm_config['wm_overlay_path']=$pathimg."/WM.png";
            $wm_config['wm_opacity']='80';
            $this->image_lib->initialize($wm_config);
            $this->image_lib->watermark();
            // END WM
        }
    }

everything is good but the thing wont resize the picture

thanks Dan.

#2
[eluser]crumpet[/eluser]
do this and see what you get
Code:
if ( ! $this->image_lib->resize()){
    return $this->image_lib->display_errors();
}

#3
[eluser]Unknown[/eluser]
Code:
$this->image_lib->watermark();// do this first;

$this->image_lib->resize();

order problem


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.