Simple Image Crop Plugin
A lightweight jQuery GUI with PHP backend for efficient image cropping.
Although cropping an image using PHP can be done with only a few lines of code, it can be a very complicated process for the average user of your web application. The Simple Image Crop script collects data (image dimensions, crop area coordinates, etc.) from the GUI and sends them to the PHP script which then actually crops an image based on that data.
UPDATE: Sorry guys, I'm currently switching hosting providers. Will be back online in a few days :)
<link rel="stylesheet" type="text/css" href="style/jquery.simpleimagecrop.css" media="all"> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="js/jquery.simpleimagecrop.js"></script>
Then put the following code in the head part as well, and modify the values to suit your needs:
Finally, put the following code in the body of your page and modify the image source with the image you want to crop (test.jpg in the example below):
<div id="crop_container" class="hidden"> <div id="crop_box"> <div id="resize_icon"></div> </div> <div id="crop_message">Leave this text here</div> <img id="image_to_crop" src="test.jpg" alt=""> <div id="crop_button"> <img src="img/cut_icon.png" alt="Crop"> </div> </div> <!-- div below can be put apart from the crop container --> <div id="crop_preview" class="hidden"> <div id="preview_message">Preview</div> <img id="image_preview" alt="Crop Preview"> </div>
The Simple Image Crop plugin is licensed under the MIT License. See the LICENSE file for details.