Re: WINNT - PHP @#%^ UP!! (Mail & attachments)

From: Date: Mon, 30 Jul 2001 13:50:03 +0000
Subject: Re: WINNT - PHP @#%^ UP!! (Mail & attachments)
References: 1 2 3 4  Groups: php.windows 
Request: Send a blank email to php-windows+get-8569@lists.php.net to get a copy of this message
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: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#8569) next »