Welcome Guest, Not a member yet? Register   Sign In
image_lib->crop() not working properly on production
#1

I'm using image_lib gd2 to crop uploaded image.
My problem now is when I upload the web files to the server(on production) and tested it, the cropped image is not what it is supposed to be. But there's no problem during development on my local computer. I've set the environment to production or development appropriately.
Does this have something to do with the server?
Reply
#2

Whad do you mean by "is not what it is supposed to be"?
Reply
#3

When i crop it for 200x200, the return thumbnail was 10x10 or something that I didn't set.
Reply
#4

I used this code and worked for me:
$config['image_library'] = 'gd2';
$config['source_image'] = '/path/to/image.jpg';
$config['x_axis'] = 300;
$config['y_axis'] = 200;
$config['width'] = 300;
$config['height'] = 200;
$config['file_permissions'] = 0644;
$config['maintain_ratio'] = FALSE;
$config['new_image'] = '/path/to/image_crop.jpg';

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

if ($this->image_lib->crop())
{
echo $this->image_lib->display_errors();
}
Reply




Theme © iAndrew 2016 - Forum software by © MyBB