Welcome Guest, Not a member yet? Register   Sign In
[solved] help me find a bug with file uploading
#1

[eluser]SPeed_FANat1c[/eluser]
Hi,
Code:
if(!$this->upload->do_upload())
            {
                //echo  $config['upload_path'];
                   $error = $this->upload->display_errors();
                echo $error.':err';    //pagal galune .err javasctriptas atskirs kad cia klaida
            }
            else
            {
                          
                $data = $this->upload->data();
                $this->load->model('Image_model','image');
                
                
                if($data['image_width'] > 700)
                {
                    
                    $task = $this->image->image_resize_for_gallery('./uploads/gallery/'.$this->input->post('album_folder').'/'.$data['file_name']);
                    if($task != 'ok')
                    {
                        echo $task.':err';    //pagal galune .err javasctriptas atskirs kad cia klaida
                    }
                    
                }
                
                if($this->image->gallery_thumb($this->input->post('album_folder'),$data['file_name']))
                {
                    
                    $this->image->gallery_enter_image($data['file_name'],$this->input->post('album_folder'));
                    
                    echo $data['file_name'];
                    
                }
                else
                {
                    echo 'Nepavyko įkelt mažos nuotraukytes:err';
                }
                
                
            }


This is code fragment from file uploading function. This works well when image_width is not > 700. But when it is > 700, then the thumbnail is not created.

Now here you can see gallery_thumb function in Image_model:

Code:
function gallery_thumb($album_folder,$image_name)
    {
        $config['image_library'] = 'gd2';
        $config['source_image']    = './uploads/gallery/'.$album_folder.'/'.$image_name;
        $config['new_image'] = './uploads/gallery/'.$album_folder.'/thumbs';
        $config['create_thumb'] = TRUE;
        $config['maintain_ratio'] = TRUE;
        $config['width']     = 75;
        $config['height']    = 50;
        
        $this->load->library('image_lib', $config);
        
        if ( ! $this->image_lib->resize())
        {
          ///  $this->image_lib->display_errors();
              log_message('error', $this->image_lib->display_errors());
            return FALSE;
        }
        else return TRUE;
    }

gallery_thumb is returning TRUE, I assume this because this

Code:
if($this->image->gallery_thumb($this->input->post('album_folder'),$data['file_name']))
                {
                    
                    $this->image->gallery_enter_image($data['file_name'],$this->input->post('album_folder'));
                    
                    echo $data['file_name'];
                    
                }


echoes $data['file_name'];

Where the problem could be that it does not create thumbnail when image_with is > 700 ?


Messages In This Thread
[solved] help me find a bug with file uploading - by El Forum - 04-26-2011, 12:24 PM
[solved] help me find a bug with file uploading - by El Forum - 04-26-2011, 02:14 PM
[solved] help me find a bug with file uploading - by El Forum - 04-27-2011, 03:28 AM
[solved] help me find a bug with file uploading - by El Forum - 04-27-2011, 04:26 AM
[solved] help me find a bug with file uploading - by El Forum - 04-27-2011, 04:32 AM
[solved] help me find a bug with file uploading - by El Forum - 04-27-2011, 04:39 AM
[solved] help me find a bug with file uploading - by El Forum - 04-27-2011, 04:56 AM
[solved] help me find a bug with file uploading - by El Forum - 04-27-2011, 05:16 AM
[solved] help me find a bug with file uploading - by El Forum - 04-27-2011, 05:44 AM
[solved] help me find a bug with file uploading - by El Forum - 04-27-2011, 06:11 AM
[solved] help me find a bug with file uploading - by El Forum - 04-27-2011, 06:22 AM
[solved] help me find a bug with file uploading - by El Forum - 04-28-2011, 08:49 AM
[solved] help me find a bug with file uploading - by El Forum - 05-02-2011, 04:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB