If you load the library and then try to resize more than one image with multiple resize calls, it’ll resize the first one but fail on the others. This is because it does not “clear” the properties associated with the Image_lib class before doing a new resize call.
Hence, the workaround is the following:
$config['source_image'] = $source_image;
$config['new_image'] = $new_image;
$config['width'] = $width;
$config['height'] = $height;
$this->load->library('image_lib');
$this->image_lib->clear();
$this->image_lib->initialize($config);
CLEAR is not documented in the user guide but it’s a function that can and should be used before recycling the library for another image manipulation. First CLEAR and then INITIALIZE with the new config parameters.
