CodeIgniter Forums

Full Version: Cropping error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Céd'[/eluser]
Hi there,

Here's the problem : my script gets images from the user's computer, after having been successfully uploaded on the server, the user is invited to crop it manually (150*150 px) via an AJAX interface. Everything was OK, until i discover that some pictures weren't cropped correctly. Most of the time, the crop is generated correctly, but randomly i got some 150*130 px or 150*113px thumbnails.

If someone can help, it will be very appreciated.

Here's the configuration of the cropping script :

Code:
$config['image_library'] = 'GD2';
$config['library_path'] = '/usr/X11R6/bin/';
$config['source_image'] = $file;
$config['x_axis'] = $x_axis;
$config['y_axis'] = $y_axis;
$config['width'] = '150';
$config['height'] = '150';
$config['new_image'] = $path.'crop/'.$orig;

El Forum

[eluser]Céd'[/eluser]
Ok I got it... I forgot that config option :
Code:
$config['maintain_ratio'] = FALSE;

My bad... i'm a fool :-)