General Question

HungryGuy's avatar

Is there a server-side utility that I can call from PHP to automatically resize and crop an image, such as an avatar, uploaded by a user?

Asked by HungryGuy (16044points) February 20th, 2010
3 responses
“Great Question” (1points)

Is there? Huh? Huh? Is there?

Observing members: 0
Composing members: 0

Answers

funkdaddy's avatar

PHP has built in (and usually enabled) image functions as well… worth checking out if you’re not doing too much.

http://php.net/manual/en/ref.image.php

HungryGuy's avatar

@funkdaddy – Oh! I didn’t realize that! I’ve been depending on online docs to look up specific syntax details. But you miss a lot of details and features like that when you don’t have a printed book on you lap to flip though and just browse. I’m going to have to go to Amazon.com and get a PHP For Dummies or some such book…

Anyway, I don’t want to do anything fancy—just resize large images that people upload as their avatars down to 100 * 100, center and crop anything that’s not perfectly square, and convert BMPs and PNGs to JPGs to save space. And if they don’t like what my site does to their avatar automatically, then they need to upload one that meets the guidelines :-)

Answer this question

Login

or

Join

to answer.

Mobile | Desktop


Send Feedback   

`