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.


Uni Project

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


Joined: 11 Feb 2005
Posts: 2
Location: Birmingham

PostPosted: Fri Feb 11, 2005 6:01 pm    Post subject: Uni Project Reply with quote

Hi Andy,

Im in my final year of computer science at Aston Uni, for my Dissertation I have been tasked with creating a website that will (in a nutshell) take in a picture(or zip file of pictures) and allow the user to crop the image to a size that can be printed in a regular photo developers (kinda like the system you get in jessops if you take in an SD card or similar and print it there)

Ive looked absolutely everywhere for an interface for this as I want to keep as much of it in PHP as possible.

One of the specifications of the site is that it doesnt store the actual cropped images just a description of what operations were done on it (e.g the pixel locations it was cropped from and to (top left, bottom right)

I was wondering if you could let me know which variables point to these values so I can go about getting an idea of how to do my project cos at the moment im totally stumped for ideas and your Crop Canvas thing has been the only bit of inspiration ive had on this

Many Thanks

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


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

PostPosted: Sat Feb 12, 2005 3:22 pm    Post subject: Reply with quote

Hi Dan and welcome to the board!

Your final year dissertation, huh? Oh boy, I remember those days!

When the interface is submitted, there query string is populated with exactly what you're looking for. In my example script that comes with the project I pass the $_GET values off to the cropping routines. At this point you could save the variables instead.

The query string consits of sx, sy, ex, ey and file. These are (respectively) start x, start y, end x, end y and the filename. The start x/y are the top-left corner of the cropping area and the end x/y represent the bottom-right of the cropping area, and they are from the top-left of the image. So given the image size which can be worked out easily, it's then no problem to be able to work out where the cropping should take place.

Hope that helps you out. If you have any further questions, just let me know. And all the best with your final year project!! 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
voycey
Newbie


Joined: 11 Feb 2005
Posts: 2
Location: Birmingham

PostPosted: Wed Feb 16, 2005 6:40 am    Post subject: Reply with quote

Cheers Andy - have had a look and i can see how it works now,
the javascript for the DHTML is quite complex - how much of it is actually needed just to do a simple crop? Im not familar with DHTML so dont really have a clue how to do it, is there a way to do a similar interactive crop using solely PHP?

thanks for all your help so far Smile
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Wed Feb 16, 2005 7:35 am    Post subject: Reply with quote

Hi,

No, you couldn't do something solely in PHP - you need some kind of interface that can be used in real-time. This would really come down to three viable options:

Javascript & DOM/DHTML
Flash
SVG

Yes, the javascript for Waltern Zorn's drag/drop is quite complex, but that's because he caters for all browsers. With your project you're guaranteed a fixed browser type (unless I'm understanding wrong... You're ideally creating a closed-box system like in Jessops, or is it going to be a web-based system that anyone, anywhere can interact with?) Assuming you have the choice of browser, you can use a DOM-based one (such as FireFox) and cut out a LOT of code.

Flash files can be generated on the fly via PHP with libraries such as Ming. This might enable you to create a much richer interface with less work. You could pre-write actionscript files to do whatever you need and then just use Ming to create the flash file to the size of the image and apply the interface.

SVG would be relatively easy to set up from scratch, perhaps. It's all XML based, but you would need a plug-in to render it (unless you have a browser with built-in SVG viewing?) As it's all XML based you can use the various PHP libraries to create and then manage the SVG file, easily store it in a database, or whatever you need. Draw back, of course, is that someone might be able to view the SVG code... But then, I'm assuming again that you'd have full control over the interface and the input options the user has.

I'm sure there are many other options out there, but those are the three that spring immediately to mind. 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