PHP Classes

Image Crop: Visual editor to let the user crop images

Recommend this page to a friend!
  Info   Screenshots Screenshots   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 47%Total: 2,390 All time: 1,631 This week: 455Up
Version License PHP version Categories
image-crop 0.1Free for non-comm...5.0PHP 5, Graphics, AJAX


This package can be used to implement a visual editor to let the user crop images.

It generates HTML, JavaScript and CSS for an user interface to let the user click on an image and define an area of the image to be cropped.

A PHP class of the package can crop the image as defined by the user and save the cropped image to a given file.

In Portuguese:

Essa classe usa uma imagem de origem[jpg, gif, png] para gerar um thumb de uma região selecionada pelo usuario, usando php e post via ajax.

Innovation Award
PHP Programming Innovation award nominee
September 2010
Number 3

Prize: One subscription to the PDF edition of the PHP Architect magazine
Many Web applications require that the users submit images with certain sizes or proportions. Often the users do not have the images in the right sizes, so they need to crop them to match the requirements.

This class helps achieving that goal with a little help of JavaScript to let the user crop the images on the browser side. Then the images are cropped on the server side according to the coordinates the user has defined with a visual user interface presented by the class.

Manuel Lemos
Picture of Carlson A. Soares
Name: Carlson A. Soares <contact>
Classes: 4 packages by
Country: Brazil Brazil
Age: 35
All time rank: 62045 in Brazil Brazil
Week rank: 298 Up16 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 2x

  • sh_001.jpg
  Files folder image Files  
File Role Description
Files folder imagejs (1 file)
Files folder imageimages (2 files)
Plain text file filemanager.php Class This class work with files and paths, used by imagecrop
Plain text file image.php Class Image manipulation class, used by imagecrop
Plain text file imagecrop.php Class The main class, this do the crop and print the user interface
Plain text file exemple.php Example Test file, see the thing working

  Files folder image Files  /  js  
File Role Description
  Plain text file jquery-1.4.2.min.js Data JQuery, used by imagecrop

  Files folder image Files  /  images  
File Role Description
  Image file cinza_40.png Data background image of the selected area
  Image file loading.gif Data Image to show when the thumb is bein generate

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:1,631
This week:455Up
User Ratings User Comments (1)
 All time
Great Job
13 years ago (deep)