There are tons of libraries for handling image out there. Wouldn't hurt to check them out. You can try phpclasses.org.
08-11-2013, 10:19 PM
I use an imaging sdk found on the internet which can crop images found on the internet . Install it and it becomes a selectable processing option.Then you can crop images in any program at all, including Adobe Acrobat . Just open the images, select crop ,and follow the setps given in the sdk, the task will be finished in several seconds. if you haven't found a good choice , you can have a try. best wishes.
08-13-2013, 03:28 PM
You need to know what size you want the image to be able to calculate the ratio.
You are taking the original height and width and creating a ratio from its aspect which bears no relationship to the size you are trying to crop to.
With sizes that you want your image to be your use the height and width to perform calculation against the uploaded image so you know how much you have to reduce the original by.
You might want to look at some of the available scripts online that produce thumbnails from images in folders.