andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


New version released!

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas
View previous topic :: View next topic  
Author Message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Tue Jun 27, 2006 5:58 am    Post subject: New version released! Reply with quote

Hi,

I'm pleased to say that the new version of the crop canvas class and interface has been released.

Changes to the core crop canvas class

The name of the class is now actually 'CropCanvas'. I've put in a stub class called 'canvasCrop' to aid transition, but it's now 'officially' CropCanvas.

All the code has been reworked and tidied up, so it's a lot cleaner and easy to navigate.

If your version of GD supports it, then GIF files can be read and written (as well as the standard JPG and PNG files).

The new getGDInfo method gets all the information about your version of GD and what it supports, all in one handy little array.

Warning/bug fixes.

Changes to the core crop canvas interface

Pretty much a complete re-write, and some methods have been renamed, others dropped and some more added. You probably could not just replace your old version with this without some small tweaking to your code (sorry!)

The interface itself has been put in an include file, inc.cropinterface.php, to provide ease of updating.

The interface is now all div and css based - no more tables! The box model hack is employed to ensure the same cropping size on IE and Firefox.

If you resize the cropping area via 'any dimension' and then swap to 'proportional' then the resizing will be proportional to whatever dimensions you currently have the cropping area to, rather than jumping to the original size and resizing proportionally from there.

You can set default sizes for the cropping area which will appear in a drop-down list for easy selection.

You can set the default cropping size in a variety of ways, be it a pixel based value such as '200x300' (200 pixels wide to 300 pixels high), or a proportion of the size such as '2/4' (half the width and a quarter of the height), or even by ratio such as 16:9 (widescreen format!), and you can give friendly names to the sizes (such as '8:10' => '8x10 portrait')

You can set the default location for the cropping area (top left, top middle, top right, left, centre, right, bottom left, bottom, bottom right).

You can set extra parameters to be submitted along with your cropping area by using the setExtraParameters method.

You can easily default if you want to resize by 'any dimension' or 'proportional'.

You can easily set it so people cannot swap what sizing type they have (ie, you can fix them into proportional cropping if you want).

You can set whether you even allow resizing of the cropping area.

The interface now shades out the area you're cropping (removing) rather than shading the area you want to have remaining.

Uses the latest version of the wz_dragdrop.js library.


All of the code has phpdoc comments so you should be able to understand what each method does just by looking at the comment blocks, plus there is an example file for each of the classes and an example in each of the top comment blocks.

For convenience I've also uploaded a zip file which contains all of the relevant files so you don't have to download them individually.

Enjoy!

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group