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.


Problem with cropinterface

 
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
netlash
Newbie


Joined: 08 Nov 2004
Posts: 3

PostPosted: Mon Nov 08, 2004 3:53 pm    Post subject: Problem with cropinterface Reply with quote

Hi - I simply love your script.

Just one problem with the interface : each time, when trying to crop, the cropped image is taken from the topleft corner - not from the place where I dragged the cropping canvas.

You can try it out at : http://www.netshots.be/test.cropinterface.php .

Do you have any idea what I'm doing wrong ?
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Tue Nov 09, 2004 3:49 am    Post subject: Reply with quote

Hi netlash, and welcome to the board!

Hmmm... I'm going to assume that you have not altered the crop canvas classes in anyway (the interface and the actual cropping class), but let me know if you have. And, assuming that you've used the test script without changed, I'm not sure you're doing anything wrong. What version of PHP and GD are you using? Can you make sure that the $_GET variable is populated correctly? (Use print_r to output the details after it's been posted). Something in those answers might help to work out what it's doing...

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: Tue Nov 09, 2004 3:59 am    Post subject: Reply with quote

Oh, and in the class.cropcanvas.php file, change the cropToDimensions method to read:

Code:
    function cropToDimensions($sx, $sy, $ex, $ey)
    {
        $nx = abs($ex - $sx);
        $ny = abs($ey - $sy);
        return ($this->_cropSize($sx, $sy, $nx, $ny, null, 'cropToDimensions'));
    }


(notice that the $position variable has been replaced by 'null')

Not sure it'll make any difference, but it's a little glitch to fix.

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


Joined: 08 Nov 2004
Posts: 3

PostPosted: Tue Nov 09, 2004 4:04 am    Post subject: Reply with quote

Thanks for the help !

Unfortunately...

I've changed the class, but with the same result.

The paramaters are populated I guess, because the resulting URL reads :

http://www.netshots.be/test.cropinterface.php?file=mypicture.jpg&sx=90&sy=105&ex=266&ey=346
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Tue Nov 09, 2004 4:15 am    Post subject: Reply with quote

I thought something like this had come up before, so looked around the cropping forum and pulled up this thread:

http://php.amnuts.com/forums/viewtopic.php?t=74

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


Joined: 08 Nov 2004
Posts: 3

PostPosted: Tue Nov 09, 2004 4:17 am    Post subject: Reply with quote

Seems like the variables are set.

How can I test what version I have for GD ? And what version is required ?
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Tue Nov 09, 2004 4:28 am    Post subject: Reply with quote

In a file, put this line:

PHP:
<?php phpinfo(); ?>


And that will give you all the information you'll ever need about your installation of PHP and additional modules you have installed, such as GD.

Version 1.82 or great of GD is required. However, some versions have bugs that other don't. That other thread mentions a bug with a combination of certain GD and PHP versions and you might be affected in the same way by it.

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