Welcome Guest, Not a member yet? Register   Sign In
Processing Multiple Images?
#1

[eluser]Pawel K[/eluser]
I have been trying to use the image library to resize an image in to a 400x400 thumbnail as well as a 200x200 thumb. I am able to do only the first image, I would appreciate any help in understanding why this is happening.

Code:
$image_info = $this->upload->data();
                    
                    $uploaded_name = $image_info['raw_name'];
                    $uploaded_ext = $image_info['file_ext'];
                    
                    chmod($image_info['full_path'], 0777);
                    
                    $thumb_name = $image_info['raw_name']."-thumb".$image_info['file_ext'];
                    $big_name = $image_info['raw_name']."-main".$image_info['file_ext'];
                    
                    #Main Image
                    $config['image_library'] = 'gd2';
                    $config['source_image'] = $image_info['full_path'];
                    $config['create_thumb'] = FALSE;
                    $config['maintain_ratio'] = TRUE;
                    $config['width'] = $this->config->item('img_width');
                    $config['height'] = $this->config->item('img_height');
                    $config['new_image'] = $big_name;
                    
                    
                    $this->load->library('image_lib', $config);
    
                    $this->image_lib->resize();
                    
                    #Thumb Image
                    $config['image_library'] = 'gd';
                    $config['source_image'] = $image_info['file_path'].$big_name;
                    $config['create_thumb'] = FALSE;
                    $config['maintain_ratio'] = FALSE;
                    $config['width'] = $this->config->item('thumb_width');
                    $config['height'] = $this->config->item('thumb_height');
                    $config['new_image'] = $thumb_name;
                    
                    $this->load->library('image_lib', $config);
    
                    $this->image_lib->resize();
                    $this->image_lib->clear();
                    
                    echo "Image 1 errors:".$this->image_lib->display_errors()."<br>";
                    
                    #Post Data
                    $prod_name = $this->input->post('product_name');
                    $prod_description = $this->input->post('product_desc');
                    $prod_price = $this->input->post('product_price');
                    $prod_cat = $this->input->post('category');


Only the first thumbnail (main) gets created. The second one doesn't. No errors show up.


Messages In This Thread
Processing Multiple Images? - by El Forum - 05-14-2010, 05:46 PM
Processing Multiple Images? - by El Forum - 05-14-2010, 07:34 PM
Processing Multiple Images? - by El Forum - 05-14-2010, 08:05 PM
Processing Multiple Images? - by El Forum - 05-14-2010, 08:10 PM
Processing Multiple Images? - by El Forum - 05-14-2010, 08:13 PM
Processing Multiple Images? - by El Forum - 05-14-2010, 08:24 PM
Processing Multiple Images? - by El Forum - 05-14-2010, 08:34 PM
Processing Multiple Images? - by El Forum - 07-27-2010, 08:35 PM
Processing Multiple Images? - by El Forum - 07-27-2010, 08:42 PM
Processing Multiple Images? - by El Forum - 02-10-2011, 06:07 PM
Processing Multiple Images? - by El Forum - 06-23-2011, 03:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB