Welcome Guest, Not a member yet? Register   Sign In
codeigniter photo thumb create and upload…
#1

[eluser]artlover[/eluser]
hi friends...

it gives blank screen :/ it uploads first image, thats fine. than it call _create_thumbnail and it gives blank screen at line "$this->image_lib->resize()" :/

any idea what can be the problem?

Thanks!!


Code:
function img_upload()
{
        $config['upload_path'] = 'uploads/';
        $config['allowed_types'] = 'gif|jpg|jpeg|png';
        $config['max_size'] = '1000';
        $config['max_width'] = '1920';
        $config['max_height'] = '1280';        
        $config['width'] = 500;
        $config['height'] = 385;                                

        $this->load->library('upload', $config);

        if(!$this->upload->do_upload()) echo $this->upload->display_errors();
        else {

                $fInfo = $this->upload->data();
                $this->_create_thumbnail($fInfo['file_name']);

                $data['uploadInfo'] = $fInfo;
                $data['thumbnail_name'] = $fInfo['raw_name'] . '_thumb' . $fInfo['file_ext'];

                // set view
                $this->load->view('upload_success', $data);    
        }
}

function _create_thumbnail($fileName)
{
        $config['image_library'] = 'gd2';
        $config['source_image'] = 'uploads/' . $fileName;      
        $config['create_thumb'] = TRUE;
        $config['maintain_ratio'] = TRUE;
        $config['width'] = 210;
        $config['height'] = 160;

        $this->load->library('image_lib', $config);
        if(!$this->image_lib->resize()) echo $this->image_lib->display_errors();

}
#2

[eluser]TheFuzzy0ne[/eluser]
It's probably because you're echoing data, and maybe you have compression enabled? I'd suggest making sure that your index.php is set to show all errors and warnings (E_ALL), and that you consider writing your debugging data to the log instead.




Theme © iAndrew 2016 - Forum software by © MyBB