AW: [PHP] Coding Help (image resizing)
| From: | Sebastian Stadtlich | Date: | Wed, 18 Oct 2000 10:52:54 +0000 |
| Subject: | AW: [PHP] Coding Help (image resizing) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-20866@lists.php.net to get a copy of this message | ||
> (1) If you mean a 'fake' resize (simply giving the image tag fake
> width and height measurements and letting the browser crush it down):
>
> Note the getimagesize() function. Among other things, it returns to
> you the width and height of the image.
>
> You can simply pick a fixed width and fixed height you'd like to work
> with. Say, 80 and 80.
>
> Read both the width and height and check which is higher. Then
> divide the other one by the longer and multiply it by 80.
>
> Then, simply spit out the image tag with 80 in the longer of width
> and height, and the integer returned in the shorter one.
>
> (2) If you mean a 'real' resize (actually saving another copy of the
> image, in order to save the user download time when looking at
> thumbnails):
you can do it by the using ImageCopyResized.
since imagecreation eats up a lot of time on your server you should also
implement some sort of cache(=save the thumbnails)
if you can wait i can send you the code later, when i'm at home :-]
sebastian