You will need to set the x-axis (left), width (right), y-axis (top), and height (bottom). You need to be sure to set the width and height of the image.
list($width, $height, $type, $attr) = getimagesize($img);
$CI->load->library('image_lib');
$config['image_library'] = 'gd2';
$config['source_image'] = $img;
$config['x_axis'] = '10';
$config['y_axis'] = '10';
$config['maintain_ratio'] = FALSE;
$config['width'] = $width-10;
$config['height'] = $height-10;
The code above will crop the image by 10 pixels on the left, right, top, and bottom. you can feel free to change the value of '10' to whichever value you prefer ;)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…