Pic resize script needs file types added...
I have a script below that resizes a jpg images. Currently only jpg files work. Can anyone tell me how to get .gif, .png, and possibly .tif and .pdf pictures to work in this script.
// The file
$filename = $_REQUEST['photo'];
// Content type
// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = $wid;
$widthratio = $new_width / $width;
$new_height = $height * $widthratio;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($image_p, null, 100);
It's amazing what a search digs up: function resize!
Last edited by bokeh; 02-17-2007 at 10:31 AM.
There you go... cheating again... Incorrigible...
That's part of the 95% of code I told you about! What should I have done differently?
Originally Posted by NightShift58
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)