Welcome Guest, Not a member yet? Register   Sign In
Image library: resizing two or more images
#8

[eluser]Marc Arbour[/eluser]
I am in a dead end with this...

I slightly adapted the above code.

Here is what I use in my controler:
Code:
in my calling function:

$this->_createThumb($file_name,100,100,$file_path,'',$file_path.'thumbs_small/', "width");
$this->_createThumb($file_name,800,300,$file_path,'',$file_path.'thumbs_large/', "height");

elsewhere in the controler

function _createThumb($file, $width, $height, $path, $marker = NULL, $newfilepath, $master_dim="auto") {
    # Lib config
    $config['master_dim'] = $master_dim;
    $config['image_library']    = 'gd2';
    $config['source_image']        = $path . $file;
    $config['new_image']        = $newfilepath . $file;
    $config['thumb_marker']        = $marker;
    $config['create_thumb']        = TRUE;
    $config['maintain_ratio']    = TRUE;
    $config['width']         = $width;
    $config['height']         = $height;
    
    # Load the library
    $this->load->library('image_lib', $config);
    
    # Resize the image and clear the lib
    $this->image_lib->resize();
    $this->image_lib->clear();
}

Only the 1st thumb is created. Wheter I change them around one another, the small or the large one gets created.

it seems the $this->image_lib->clear(); is not working properly.

Any ideas? (using latest CI version)

Duke


Messages In This Thread
Image library: resizing two or more images - by El Forum - 11-27-2009, 10:14 PM
Image library: resizing two or more images - by El Forum - 11-28-2009, 11:34 AM
Image library: resizing two or more images - by El Forum - 11-28-2009, 01:00 PM
Image library: resizing two or more images - by El Forum - 11-28-2009, 02:42 PM
Image library: resizing two or more images - by El Forum - 11-28-2009, 02:55 PM
Image library: resizing two or more images - by El Forum - 11-28-2009, 03:01 PM
Image library: resizing two or more images - by El Forum - 11-28-2009, 03:35 PM
Image library: resizing two or more images - by El Forum - 04-09-2010, 09:44 AM
Image library: resizing two or more images - by El Forum - 04-09-2010, 09:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB