In my application i have an image in a div,a button.
I want to rotate the image displayed and save the rotated image when i clicked on the button using jquery.
You can try my solution to rotate the image
_path = $path;
$this->_degrees = $degrees;
}
public function rotate() {
$image = new Imagick($this->_path);
$image->rotateimage('black', $this->_degrees);
echo $image->getImageBlob();
exit();
}
}
if($_SERVER['REQUEST_METHOD'] == 'GET'){
$sourceImagePath = isset($_GET['image_path']) ? $_GET['image_path'] : null;
$degrees = isset($_GET['degrees']) ? $_GET['degrees'] : 90;
$obj = new RotateImage($sourceImagePath, $degrees);
return $obj->rotate();
}
?>