I\'m trying to create a Thumbnail Generator in PHP with GD that will take an image and reduce it to a fixed width/height. The square it takes from the original image (based on m
Is this what you're looking for:
Crop-To-Fit an Image Using ASP/PHP
The script can be used to create square thumbnails out of portrait/landscape images. The solution requires two steps:
1: resize the image proportionally so that one of the dimension matches the desired dimension while other is equal or greater.
2: crop from the middle of the image; the math is simple.