Log in

View Full Version : resizing picture



gurmeet
06-16-2010, 02:04 AM
i need help in resizing pictures...
i ,made a PHP script which resizes user uploaded images.....

when the picture is uploaded the it is shown on page by the size 100 x 150. but sometime user upload larger pictures and some time smaller pictures...

what i want , when user uploads larger pictures the picture should be resized to 100 x 150, but it must be in the same ratio as the user uploads ...


i.e. if user uploads picture 200 x 400 it must be resized in the same ratio

can any1 help?

djr33
06-16-2010, 03:35 AM
Look at php.net:
http://www.php.net/manual/en/function.imagecopyresized.php

Look through some of the comments.
For example,
http://www.php.net/manual/en/function.imagecopyresized.php#68631

This is a common question, so try a search first.