PHP Classes
elePHPant
Icontem

Crop Canvas: A class to crop images in a variety of ways.

Recommend this page to a friend!
  Info   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum (6)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2006-11-29 (9 years ago) RSS 2.0 feedStarStarStarStar 65%Total: 4,927 All time: 522 This week: 923Down
Version License Categories
crop-canvas 1.0Free for non-comm...Graphics
Description Author

This is a class allows you to crop an image in a variety of ways.

You can crop in an absolute or relative way (to a certain size or by a certain size), both as a pixel number or a percentage.

You can also save or display the cropped image.

The cropping can be done in 9 different positions: top left, top, top right, left, centre, right, bottom left, bottom, or bottom right.

Or you can have it automatically cropped based on a threshold value.

The original image can be loaded from the file system or from a string (for example, data returned from a database.)

It will also compensate so you can use GD versions 1.x or 2.x (though obviously 2.x will produce much better results!)

Picture of Andrew Collington
  Performance   Level  
Name: Andrew Collington <contact>
Classes: 13 packages by
Country: United Kingdom United Kingdom

  Files folder image Files  
File Role Description
Plain text file class.cropcanvas.php Class The main class file.
Plain text file class.cropinterface.php Class A web-based interface to the crop canvas class.
Accessible without login Plain text file inc.cropimage.php Aux. Dynamically outputs a resized image.
Accessible without login Plain text file inc.cropinterface.php Aux. The client-side code for the cropping interface.
Accessible without login Plain text file inc.cropjavascript.php Aux. Initiates elements to be handled by javascript.
Accessible without login Plain text file test.cropcanvas.php Example Just to show a few ways the class can be used.
Accessible without login Plain text file test.cropinterface.php Example Demo of cropping interface
Accessible without login Plain text file wz_dragdrop.js Aux. The drag & drop javascript behind the cropping interface. This code is created by Walter Zorn (http://www.walterzorn.com/dragdrop/dragdrop_e.htm).

 Version Control Unique User Downloads Download Rankings  
 0%
Total:4,927
This week:0
All time:522
This week:923Down
User Ratings User Comments (4)
 All time
Utility:96%StarStarStarStarStar
Consistency:90%StarStarStarStarStar
Documentation:-
Examples:82%StarStarStarStarStar
Tests:-
Videos:-
Overall:65%StarStarStarStar
Rank:646
 
This script is one of the best scripts for image cropping fro...
5 years ago (Iftikhar Mirza)
70%StarStarStarStar
Really, really great.
6 years ago (pablo)
67%StarStarStarStar
Just what I wanted, saved me the Job, thanks!!
7 years ago (Piet Hermans)
70%StarStarStarStar
Very useful
8 years ago (Nguyen Duc Phu)
67%StarStarStarStar