brad62 — 2013-02-19T06:01:36-05:00 — #1
I'm looking for a script where I can upload an image and then crop this to a perfect square.
The final image that is saved should be 200 x 200 pixels.
So, if the uploaded image is too small, I want it to fill the rest of the area with white.
If the uploaded file is too wide or too high, the user should be able to crop the part they want to be the visible 200x200 pixels.
I found this script http://keithics.com/blog/jquery/ajaxcrop-jquery-and-php-crop-tool
But I don't understand where to change the bits and pieces to make it work for me.
I want to make it simple and don't need the user input fields where they have to set the size and things like that.
I just want them to use the upload button and the crop tool and then end up at another page where I can have their uploaded picture showing and also have the url to the image inserted into my db.
Does anyone know what to change in this script or if there is something simple out there that might just do what I'm looking for?
jimmybrion — 2013-02-19T06:28:28-05:00 — #2
I think Jquery Jcrop plugin might help you. Please google it.
brad62 — 2013-02-19T08:33:51-05:00 — #3
Thanx Jimmybrion. Testing that one as we speak. Looks great. I will see if I can make that one work.
wh33t — 2013-02-21T20:02:10-05:00 — #4
I have used a jQuery script to achieve that very result before and it was very sleek. However there is quite often some hefty PHP attached to pulling that off. Obviously jQuery itself cannot achieve this. Are you familiar at all with the GD library of PHP? It's truly incredible in the amount of things it can do. It was a bit of a learning curve for me but I'm very glad that I took the time to familiarize myself with it. Since then I have written an image.class that I can call upon, pass a few variables into it and achieve a whole plethora of functionality very quickly.