EllisLab/CodeIgniter — Issue #1059: image library is not worked correctly when call it many times.
Author: chokchai
Created: 2012-02-18 10:55:35+00:00
State: open

for example.

$this->load->library('image_lib');

$config = Array( ... ); //assume is config somethings in my case is about "re-size"

$this->image_lib->initialize($config);
$this->image_lib->resize();
$this->image_lib->clear();

$config2 = Array( ... ); //assume is config somethings in my case is about "create new thumbnail from re-sized image"

$this->image_lib->initialize($config2);
$this->image_lib->resize();
$this->image_lib->clear();

Expected: is re-sized and create new thumbnail from re-sized image.
Actual: the first image is re-sized (into thumbnail size that in $config2) and is not create a new thumbnail.

-------------------------------

FYI - I has fixed this problem by this...

$config = Array( ... ); //assume is config somethings in my case is about "re-size"

$this->load->library('image_lib', $config);
$this->image_lib->resize();
$this->image_lib->clear();

$config2 = Array( ... ); //assume is config somethings in my case is about "create new thumbnail from re-sized image"

$this->load->library('image_lib', $config2, 'image_lib_thumb');
$this->image_lib_thumb->resize();
$this->image_lib_thumb->clear();

that worked fine like expected !

------------------------------------

Best Regards