* Thus wrote Leif K-Brooks ([EMAIL PROTECTED]):
> Vijaya_Manda wrote:
> 
> >Is there any pre-written code available on the net to generate thumbnail
> >images for a picture.
> >I mean I send the path of the image and my PHP Script should be able to
> >generate a gif file of size 100x71 or something like that.
> > 
> >
> Images will look stretched if you do that, but here are two functions to 
> resize an image with a new width or height proportional to its current 
> size. Pass them GD image resources created with imagecreatefrompng() and 
> friends.

you could center a proportinal image onto a 100x71 background
image.

if (width > height) {
  resize width to 100
  resize height = height / (int) width/100
} else {
  resize height to 71 
  resize width = width / (int) height/71
}
put resized image in center of 100x71 image.


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
    http://zirzow.dyndns.org/html/mlists/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to