Ratings | | Unique User Downloads | | Download Rankings |
57% | | Total: 396 | | All time: 6,603 This week: 54 |
|
Description | | Author |
This class can crop an image to a given position and size.
It can take a given image file in GIF, JPEG or PNG format and creates a new image that is cropped from the original at given coordinates, width and height.
The package uses a jQuery plugin to send to the server the image and the crop coordinates via AJAX. | |
|
Example
<?php
/* Copyright 2015 Crop Image Plugin (email : manudg_1@msn.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require "cropImage.class.php";
$image_src = $_POST["image"];
$new_image_src = "thumb/thumb-".basename($image_src);
$width = intval($_POST["width"]);
$height = intval($_POST["height"]);
$x = intval($_POST["x"]);
$y = intval($_POST["y"]);
/* Set options */
$options = array(
'image_src' => $image_src,
'new_image_src' => $new_image_src,
'width' => $width,
'height' => $height,
'x' => $x,
'y' => $y,
);
$cropImage = new cropImage($options);
?>
<h3>Cropped image saved in the folder thumb :)</h3>
<hr />
<img src="<?php echo $cropImage->getNewImage() ?>" />
|
Details
crop-image-plugin - PHP + jQuery UI + Ajax
<p>This class can crop an image to a given position and size.</p>
<p>It can take a given image file in GIF, JPEG or PNG format and creates a new image that is cropped from the original at given coordinates, width and height.</p>
<p>The package uses a jQuery plugin to send to the server the image and the crop coordinates via AJAX.</p>
<ul>
<li>· Supported image types: jpg, jpeg, png and gif</li>
<li>· Requeriments: PHP 5.x and GD Graphics Library</li>
</ul>
<img src="https://github.com/ManuDavila/crop-image-plugin/blob/master/screenshot.jpg" />
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.