Solved

PHP Jquery Image upload and crop

Posted on 2011-09-29
13
760 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

707 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