Page 1 of 1
how to change image width and height
Posted: Tue Jul 01, 2003 5:00 am
by mustafa
is there any function in php with which we can change the width and height of an image.i have seen so many functions which can get the image wifth and height but i could not find the function which can change the image width and height.
Posted: Tue Jul 01, 2003 5:06 am
by twigletmac
I have moved this to PHP - Normal as it is better suited for questions like this than the PHPMac.com forum.
Mac
Posted: Tue Jul 01, 2003 9:54 am
by cactus
The physical dimensions of an image can only be changed through the use of ImageMagik or the GD libs via PHP.
ImageMagik is a command line tool which you can exec commands to from PHP:
http://freealter.org/doc_distrib/ImageMagick-5.1.1/
Or with the use of GD you can manipulate the image:
http://www.boutell.com/gd/
Both require you to have certain libs/binaries installed on your server.
Regards,
Posted: Tue Jul 01, 2003 1:04 pm
by pootergeist
If you have a version of GD beyond 2.0 you could adapt my thumbnailing class to do the resizing
http://www.teckis.com/scriptix/thumbnails/teck.html
for simple resizing, just
$variable = new Thumbnail('resource.jpg',200,150,'output_image.jpg',85,'');
$variable->create();
would be all that is required (after including the class

).