Hey!
Thanks for sharing mate!
I'll run it and get back to you if I have any problems.
Cheers,
Ryan
On 3/22/2005 10:49:42 PM, Andras Kende ([EMAIL PROTECTED]) wrote:
> > Hi,
>
> > I found this beautiful piece of code on the php site which make a
>
> > proportional thumbnail, problem is its only working with JPEG files...
> and
>
> > not with GIFs, can someone please help me convert it to GIF too?
>
> >
>
> > I tried but got a bit confused as there are no functions that are equal
> to
>
> > "imagecreatetruecolor" that is in the below script.
>
> > The below script works perfectly for jpgs:
>
> >
>
> >
>
> > <?php
>
> > // The file
>
> > $filename = 'test.jpg';
>
> >
>
> > // Set a maximum height and width
>
> > $width = 200;
>
> > $height = 200;
>
> >
>
> > // Content type
>
> > header('Content-type: image/jpeg');
>
> >
>
> > // Get new dimensions
>
> > list($width_orig, $height_orig) = getimagesize($filename);
>
> >
>
> > if ($width && ($width_orig < $height_orig)) {
>
> > $width = ($height / $height_orig) * $width_orig;
>
> > } else {
>
> > $height = ($width / $width_orig) * $height_orig;
>
> >
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.0 - Release Date: 3/21/2005
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php