i'm new to php but fluent in asp. i'm running php 4.04 and gd library 1.3 for
gif support. i'm simply trying to create a thumbnail from an existing gif
file. the code i'm using errors on the final imagegif() property. has anyone
used php for thumbnailing gif's before? here's my php link followed by the
code.
thanks for your help - brian
http://templates.inetcity.com/admin/siteadmin_images3_gif.php
THE CODE:
<?php
function ResizeGif( $image, $newWidth, $newHeight){
//Open the gif file to resize
$image = "gallery/1/memories1.gif";
$srcImage = ImageCreateFromGif( $image );
//obtain the original image Height and Width
$srcWidth = ImageSX( $srcImage );
$srcHeight = ImageSY( $srcImage );
// the follwing portion of code checks to see if
// the width > height or if width < height
// if so it adjust accordingly to make sure the image
// stays smaller then the $newWidth and $newHeight
if( $srcWidth < $srcHeight ){
$destWidth = $newWidth * $srcWidth/$srcHeight;
$destHeight = $newHeight;
}else{
$destWidth = $newWidth;
$destHeight = $newHeight * $srcHeight/$srcWidth;
}
// creating the destination image with the new Width and
Height
$destImage = imagecreate( $destWidth, $destHeight);
//copy the srcImage to the destImage
ImageCopyResized( $destImage, $srcImage, 0, 0, 0, 0,
$destWidth, $destHeight,
$srcWidth, $srcHeight );
//create the gif
ImageGif( $destImage );
//fre the memory used for the images
ImageDestroy( $srcImage );
ImageDestroy( $destImage );
}
//save output to a buffer
ob_start();
//Resize image ( will be stored in the buffer )
ResizeGif( $image, "100", "100");
//copy output buffer to string
$resizedImage = ob_get_contents();
//clear output buffer that was saved
ob_end_clean();
//write $resizedImage to Database, file , echo to browser
whatever you need to do with it
echo $resizedImage;
?>
Phil Driscoll wrote:
> On Monday 30 July 2001 14:22, Leon wrote:
> > Here it is:
> >
> > When installing PHP, the installer places the php.ini file in the profile
> > of whoever is running the installer...
>
> Whoa! Which installer does this? Certainly not the one on the www.php.net
> site!
> --
> Phil Driscoll
>
> --
> PHP Windows 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 Windows 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]