milov.nl

Interaction design • webdevelopment • web art • photography

milov.nl : forum : coding : 'Resize image in PHP?'

Resize image in PHP? Ayt, 050504 20:11
I have a PHP program, witch allows you to add images to the database and view those images. I the front page, it will display two images. If the image is large, it will take forever to load. The image size on the page is only about 400 * 400 pixels. Is it somehow possible to "resize" the image eg. "image.php?id=8&xsize=400&ysize=400".

Thank you.
YYYMKDCCLXXXVII.dsl.saunalahti.fi
Re: Resize image in PHP? Jan!, 050505 20:10
http://php.net/imagecopyresized

Use $_GET['xsize'] and $_GET['ysize'] for the width and height.
dD577249E.access.telenet.be
Re: Resize image in PHP? Milo, 050505 21:02
Also, from what I understand, http://php.net/imagecopyresampled will give prettier results than imagecopyresized.
milov.demon.nl
Re: Resize image in PHP? Jan!, 050506 18:21
Oh, right, how silly of me not to mention that function!
dD577249E.access.telenet.be
Re: Resize image in PHP? Ayt, 050506 19:22
Yes, I have also noticed that "imagecopyresampled()" gives better quality. Thanks for the answers.
a81-197-36-186.elisa-laajakaista.fi
Pages: 1