Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

php image resize

Is there a built in php function that lets you resize an image to a specific width & height?

Even better, give it one or the other & it retains the aspect ratio?

Thanks
Avatar of Robert Saylor
Robert Saylor
Flag of United States of America image

You could use GD or imagemagic. Image magic is really easy to use but would require exec from the command prompt. GD does not require that but is more code. If you look at ImageMagic look at "convert".

Version: ImageMagick 6.7.2-5 2011-09-13 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP

Usage: convert [options ...] file [ [options ...] file ...] [options ...] file
Avatar of Richard Korts

ASKER

I have GD; what is the syntax there?

It seems I've done this before. Isn't there a function like imageresize?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Robert Saylor
Robert Saylor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's it, I've used it before.

Thanks!
No problem :)