jquerycropping,codiegniter,php
- by user345804
I want to crop the image using jquery,codigniter
in jquery i get four coordinate of image x1=249 x2=326 y1=194 y2=271 w=77 h=77
in codiegniter done the query
function do_crop()
{
$x=249;
$y=194;
$w=77;
$h=77;
$path= 'system/application/';
$config = array(
'image_library' => 'gd2',
'source_image' => $path.'/jag1/flowers.jpg' ,
'new_image' => $path.'/jag2/flowers.jpg',
'maintain_ration' => false,
'width' => $w,
'height' => $h,
'x_axis' => $x,
'y_axis' => $y
);
$this->load->library('image_lib');
$this->image_lib->initialize($config);
if ( ! $this->image_lib->crop())
{
echo $this->image_lib->display_errors();
}
$this->image_lib->clear();
}
i get cropped image. But problem is don't get exact cropped image x,y coordinate problem