I have one currently that simple does it by aspect ratio, however I need it to fill a 150 x 150 size, whereas mine would honour its ratio and do 150 x 120 for example.
Ideally it would goto the centre of the image.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
While I think haim’s offered link is very good to use, you may want to consider using ImageMagick, which is a multi-language-supported software that I personally believe many hosting companies have. I think it’s a more efficient way of implementing what you’re looking for, rather than resizing/cropping with GD library.
Take a look at this built function. It also allows caching, and copying remote images to your server.