You must have the gd library compiled into PHP for this
http://www.php.net/manual/en/ref.image.php
<?
  $directory = getcwd();
  $directory = $directory."/photos";

  $size = GetImageSize("$directory/$image");  // feed the name of the
original image here.
  $width = $size[0];
  $height = $size[1];

  $new_w=100;  // set this to what you want the new fixed-width to be

  $ratio = $new_w/$width;
  $new_h=$height*$ratio;

  $dst_img=ImageCreate($new_w,$new_h);

  $src_img=ImageCreateFromjpeg("$directory/$image");


ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),I
mageSY($src_img));

  ImageJpeg($dst_img,"$directory/thumbnail.jpg",75);
?>



----- Original Message -----
From: "Steph" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 09, 2001 11:27 AM
Subject: [PHP] Image thumbnail creation


> Hi all! New to the list and new to PHP. Im trying to create Image
thumbnail
> dynamically versus creasting them manually via my graphics program.
>
> Thanks,
> Steph
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to