RE: [PHP] Re: Image Resizing

From: Date: Thu, 07 Dec 2000 22:02:34 +0000
Subject: RE: [PHP] Re: Image Resizing
Groups: php.general 
Request: Send a blank email to php-general+get-29221@lists.php.net to get a copy of this message
Just use GD. Here's a copy of a previous post explaining how to do this. -------------------------------------------------------------------------- You must have the GD library installed. I will use the JPEG functions here; you will need to change them to whatever kind of image you are working with. //Set the new width and height $newWidth = 100; $newHeight = 100; //Get the old image $origImage = ImageJpeg("my_image.jpg"); $oldWidth = ImageSX($origImage); $oldHeight = ImageSY($origImage); //make the new one $newImage = ImageCreate($newWidth, $newHeight); ImageCopyResized( $newImage, $oldImage, 0, 0, 0, 0, $newWidth, $newHeight, $oldWidth, $oldHeight ); // Then save and/or output the image ie. // Header("Content-type: image/jpeg"); // ImageJpeg($newImage, 100); Good luck! Jack -----Original Message----- From: Paul Mullen [mailto:pem@nellump.com] Sent: Thursday, December 07, 2000 12:44 PM Cc: PHP List Subject: [PHP] Re: Image Resizing >Install ImageMagik? Is this too obvious? you could use gimp, a long Why not just use PHP's built-in image functions? imagecopyresized() comes to mind... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#29221) next »