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.


Image reseize in Crop Interface possible

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


Joined: 06 Aug 2004
Posts: 4

PostPosted: Fri Aug 06, 2004 4:18 am    Post subject: Image reseize in Crop Interface possible Reply with quote

Hello to the community. I searched a very long time to find a script like this. It is very great. I wanted to implement the script in a site where users have to upload their logos and cut it to the seize i wanted to have. As a special feature i want to allow them to change their picture size. I try to use the code from walterzorn to implement this feature but as you can see the cut does not work right. Can anyone help me.


http://www.beneluxbusinessguide.com/obg/piccut/test.cropinterface.php
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Fri Aug 06, 2004 7:46 am    Post subject: Reply with quote

Hi, and welcome to the board!

Your problem lies with the way you are sizing the image. In the original crop canvas class you size the cropping area, while retaining the image at a constant size. This way you know where on the image the cropping area starts and how big it is. However, because you resize the image and not the cropping area, you'll have to return the cropping area dimensions relative to the size of the image after you've clicked on the +/- buttons.

Make sense?

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


Joined: 06 Aug 2004
Posts: 4

PostPosted: Fri Aug 06, 2004 8:56 am    Post subject: Reply with quote

It makes sense. So if i wanted to have a dimension change of the image i have to change the original picture. And then i can crop. I noticed that the crop is alwys taken from the original image. Not from the picture how it is now. Would be a nice feature or? I will try to use the other class from you where i can reseize the image. And then restart the crop interface with the new picture.

Thanks for help. Will keep you up to date with my work.
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Fri Aug 06, 2004 9:17 am    Post subject: Reply with quote

You could do it that way, but what I was suggesting was something more along the lines of when you submit the form, but add/subtract whatever values you need from the cropping area size/position.

Say that you had your image a normal size, and your cropping area is 80x80 in size and 100px in from the left and 100px in from the top. If you subitted right now you would send something like 'sx=100&sy=100&ex=180&ey=180' back to the server.

Now imagine that you have increased your image twice. Each time you do you're adding 20 pixels to the size of the image (both height and width). You cropping area size is now 80 - 40 because increasing the image size is relative to decreasing the cropping size amount. This goes the same for the position. If you increase the image size by 20 in both directions, it's like moving the cropping area up and left that same amount.

Something like that, anyway. Smile

The javascript function 'my_Submit()' would be the one you want to update to reflect these changes.

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