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.


Interactive cropping interface

 
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: Thu Nov 27, 2003 5:48 am    Post subject: Interactive cropping interface Reply with quote

Hi,

I've started to work on something a little different... As some of you know; the majority of my classes are just for the grunt work, and it's left up to you to provide an interface. However, I've decided to throw together an interface for the cropping class which goes above what the demo script does.

After a couple hours playing around, and thanks to the wonderful work provided here:

http://www.walterzorn.com/dragdrop/dragdrop_e.htm

I have something to show, which I am really happy with. It's not ready for distribution yet, but you may want to check it out anyway:

http://php.amnuts.com/demos/crop-canvas/interactive/

Let me know what you think. If there's interest, then I'll continue to develop it. If not, then I probably won't. Smile

Cheers,

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
sderuiter
Newbie


Joined: 26 Nov 2003
Posts: 9

PostPosted: Thu Nov 27, 2003 2:32 pm    Post subject: Reply with quote

Unbelievable! This is EXACTLY what I'm looking for. Good that I'm frequently checking this forum, because I was just editing your code to allow for an x and y offset value. Together with the 9 positions, this will give me exact flexibility on which portion to crop.

However................your script is so much better, I'll stop right away Laughing

In my case I would want to fix to size of the crop, but I assume this is fairly easy?

Again, willing to share this code (even in a premature phase)?

Regards,

sderuiter
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Thu Nov 27, 2003 6:25 pm    Post subject: Reply with quote

sderuiter wrote:
Again, willing to share this code (even in a premature phase)?


I am willing to share, and I hope to have something up for you to check out tomorrow. I've put it in a class that extends the original crop canvas so it's easy for you to include in your own code. With only four lines (oh yes, I said only four lines!!) you can display it, and then with the results you can use the standard canvas crop functions to display or save the image. For example:

PHP:
<?php

    
require_once 'class.cropinterface.php';
    
$ci = new cropInterface();
    
$ci->loadInterface($file);
    
$ci->loadJavaScript();
    
?>


And if you want to turn off the resizing function and/or fix the crop area size, you just need a couple extra lines, such as:

PHP:
<?php

    
require_once 'class.cropinterface.php';
    
$ci = new cropInterface();
    
$ci->setResizing(false);
    
$ci->setCropSize(150100);
    
$ci->loadInterface($file);
    
$ci->loadJavaScript();
    
?>


If you do that then the extra options for resizing will disappear from the interface.

So check out that demo again and see if things work out for you still. If all goes well, I'll put up a beta version tomorrow (or sometime this weekend).

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
amnuts
Site Admin


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

PostPosted: Mon Dec 01, 2003 4:31 pm    Post subject: Reply with quote

Hi,

The URL for the cropping interface has changed to:

http://php.amnuts.com/demos/crop-canvas/

why? Because I just released it!! See other thread for details.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
mkuplens
Newbie


Joined: 14 Mar 2004
Posts: 3

PostPosted: Mon Mar 15, 2004 1:07 am    Post subject: Reply with quote

Weird - i'm trying to get the class to work when held within a table - seems like whenever the code is called within a <td>, it breaks (fails to load the image, etc.)

This is occurring in IE6, btw - opera seems to handle it okay

Any thoughts as to why this might be occuring?
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Mon Mar 15, 2004 5:19 am    Post subject: Reply with quote

Hi,

Hmmm.... Is the call to the javascript function the very last thing on the page? That should really come just before the '</body>' tag. If you want to post up your code then I can try it out and see if I get the same results as you.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
mkuplens
Newbie


Joined: 14 Mar 2004
Posts: 3

PostPosted: Mon Mar 15, 2004 5:59 am    Post subject: Reply with quote

Ah!

Now I get it.

How curious - undocumented requirement? Smile

Cheers - moved the javascript call to the very last line, and all is good.

Sweet.
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Mon Mar 15, 2004 6:14 am    Post subject: Reply with quote

mkuplens wrote:
How curious - undocumented requirement? Smile


Only if you discount this in the code:

Code:
    /**
    * @return void
    * @desc Load the javascript required for a functional interface.
    * This MUST be called at the very end of all your HTML, just before the closing body tag.
    */
    function loadJavaScript()
    {


Wink

I agree, though.. Not very upfront, is it? Perhaps if would be better that I actually write some proper documentation for the classes! Maybe I'll attempt that with the next version of the class.

mkuplens wrote:
moved the javascript call to the very last line, and all is good.


Glad it works! Smile

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