EllisLab text mark
Advanced Search
     
Possible Image Lib bug?
Posted: 09 September 2007 05:21 PM   [ Ignore ]
Joined: 2007-06-28
34 posts

Is this a bug or am I just not getting it:  I upload an image, resize it to $x1,$y1 then thumbnail it to $x2,$y2. So i should have 2 images.. one called image.jpg and another called image_thumb.jpg.

//$path= path to file, $x,$y are size demisions
function _image_resize ($path,$x1,$y1,$x2,$y2)
        
{

                        $this
->image_lib->clear();
                        
//resize Image
                        
$config['image_library''GD2';
                        
$config['source_image'$path;
                        
$config['width'$x1;
                        
$config['height'$y1;
                        
$config['master_dim''auto';
                        
$config['quality''100%';

                        
$this->image_lib->initialize($config);
                        
$this->image_lib->resize();
                        
                        
$this->image_lib->clear();
                        
//thumbnail the image just resized
                        
$config2['image_library''GD2';
                        
$config2['source_image'$path;
                        
$config2['width'$x2;
                        
$config2['height'$y2;
                        
$config2['master_dim''auto';
                        
$config2['quality''100%';
                        
$config2['create_thumb'TRUE;

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

What I am actually getting from this function is 1 image called image.jpg (no _thumb) sized to $x2,$y2 (the thumbnail specs).  Any thoughts?

 
Posted: 09 September 2007 06:07 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2007-06-28
34 posts

Solution:
added

unset($this->image_lib);
$this->image_lib = new CI_Image_lib();

between iterations.. works.