Welcome Guest, Not a member yet? Register   Sign In
How can i load a library file in a helper file?
#6

[eluser]haraldo[/eluser]
My code is as below:

Code:
function resize_image( $file_path ) {
        
    $ci = get_instance();
    
    $ci->load->library( 'image_lib' );
    $image['image_library'] = 'gd2';
    $image['source_image']    = $file_path;
    $image['create_thumb'] = TRUE;
    $image['maintain_ratio'] = TRUE;
    $image['width'] = 80;
    $image['height'] = 60;

    $ci->image_lib->initialize( $image );

    if( $ci->image_lib->resize() ) {

        $ci->image_lib->clear();
        return true;
    }

    return false;
}


Messages In This Thread
How can i load a library file in a helper file? - by El Forum - 11-07-2008, 06:48 AM
How can i load a library file in a helper file? - by El Forum - 11-07-2008, 06:57 AM
How can i load a library file in a helper file? - by El Forum - 11-07-2008, 06:59 AM
How can i load a library file in a helper file? - by El Forum - 11-07-2008, 07:10 AM
How can i load a library file in a helper file? - by El Forum - 11-07-2008, 07:19 AM
How can i load a library file in a helper file? - by El Forum - 11-07-2008, 07:19 AM
How can i load a library file in a helper file? - by El Forum - 11-07-2008, 07:38 AM
How can i load a library file in a helper file? - by El Forum - 11-07-2008, 07:54 AM
How can i load a library file in a helper file? - by El Forum - 11-07-2008, 08:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB