Solved

PHP Jquery Image upload and crop

Posted on 2011-09-29
13
740 Views
Last Modified: 2012-05-12
Hi Experts,

I am farily new to PHP and jquery so as much detailed help as possible would be greatly appreciated

I need to do the following:

1. Upload an image
2. Crop it to become equal width and length (i.e. Square)
3. Resize it to say 300 x 300 pixels
4. Rename it and save it to a folder

Please someone patch a script together to help!!!

MANY THANKS IN ADVANCE
0
Comment
Question by:maccaj51
  • 6
  • 6
13 Comments
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 36815627
what kind of images to you need to work with?
0
 

Author Comment

by:maccaj51
ID: 36815652
jpg, gif or png would be great!
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36815685
0
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 36815689
you can use the gd library in php to do this.
look in your php_info and see if you have it installed already, most newer version of php do, and it should also tell you what version of it you have.

http://php.net/manual/en/book.image.php
This the manual for it.
Give me a few minutes and I will get something together.
0
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 36815700
imagemagick is nice but it can be a pain to install and use.
0
 

Author Comment

by:maccaj51
ID: 36815706
I do indeed have it installed... Halo your a legend!
0
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 36815867
I can arbitrarily crop the image, any size that you want it cropped to, say if the height is larger crop to width or the other way around?
0
 

Author Comment

by:maccaj51
ID: 36815880
It would be nice for the user to crop it... i.e. Jcrop or something like that...

I am making a basic CMS... the images on the site need to be square but i dont trust the users photoshop skills - hence being able to crop online...

Does this make sense?
0
 

Author Comment

by:maccaj51
ID: 36815882
Basically so they can choose the focus of the image aswell...
0
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 36815901
so would the locations be passed in with the image so that you don't have to worry about calculating an sort of best location and size.
If that is so this gets easier to do.
I will assume that the locations that are being cropped will be passed in.
0
 

Author Comment

by:maccaj51
ID: 36815915
0
 
LVL 13

Accepted Solution

by:
haloexpertsexchange earned 500 total points
ID: 36815940
looks cool, much faster than having to write stuff up by hand and should have most of the bugs fixed already.
0
 

Author Closing Comment

by:maccaj51
ID: 36930061
Thanks for your help!
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question