Login   Register  
PHP Classes
elePHPant
Icontem

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

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum (5)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2006-11-29 (7 years ago) RSS 2.0 feedStarStarStarStar 65%Total: 4,893 All time: 495 This week: 1,503Down
Version License Categories  
crop-canvas 1.0Free for non-commercial...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
Name: Andrew Collington <contact>
Classes: 13 packages by
Country: United Kingdom United Kingdom
Age: 40
All time rank: 514 in United Kingdom United Kingdom
Week rank: 1128 Down41 in United Kingdom United Kingdom Down

  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,893All time:495
 This week:0This week:1,503Down
User Ratings User Comments (4)  
 All time
Utility:96%StarStarStarStarStar
Consistency:90%StarStarStarStarStar
Documentation:-
Examples:82%StarStarStarStarStar
Tests:-
Videos:-
Overall:65%StarStarStarStar
Rank:443
 
This script is one of the best scripts for image cropping fro...
3 years ago (Iftikhar Mirza)
70%StarStarStarStar
Really, really great.
4 years ago (pablo)
67%StarStarStarStar
Just what I wanted, saved me the Job, thanks!!
5 years ago (Piet Hermans)
70%StarStarStarStar
Very useful
6 years ago (Nguyen Duc Phu)
67%StarStarStarStar