• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with thumbnail generation

#1
[eluser]brigham[/eluser]
I can't seem to get the image_lib library to generate a thumbnail. The following code generates an error message:
Code:
function test()
    {
        // Create thumbnail            
        $config['image_library'] = 'GD';
        $config['source_image'] = './public/images/avatars/brigham.jpg';
        $config['create_thumb'] = TRUE;
        $config['maintain_ratio'] = TRUE;
        $config['width'] = 50;
        $config['height'] = 50;
        
        $this->load->library('image_lib', $config);
        
        $this->image_lib->resize();
    }
...and the error message is
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Image_lib::$dest_image
Filename: libraries/Image_lib.php
Line Number: 476
What am I doing wrong? I've tried specifying 'dest_image' and 'new_image' in the config file, but the same error appears.
Thanks,
Brigham

#2
[eluser]pushpa[/eluser]
<?php
include('Image.php');
$image = new Image();
$image->load('pic1.jpg');
$image->resize(250,400);
$image->save('pic2.jpg');
?>
http://wintekweb.blogspot.com/2012/11/re...h-php.html


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.