image resize problem
Posted: Thu Mar 10, 2005 12:42 am
Code: Select all
$image = "e;test.jpg"e;;
$width = "e;120"e;;
$height = "e;120"e;;
function ResizeImage($image ,$width ,$height)
{
//image resizer by myscripting
//get the size of the original
$size = GetImageSize($image);
//divide the width / height percentage by 100
$new_width = 100 / $width;
$new_height = 100 / $height;
//store the resized dimensions in a variable
$sizeh = $sizeї1]/ $new_height;
$sizew= $sizeї0]/ $new_width;
//display the new resized image
$new_image = "e;<img src = \"e;$image\"e; height=\"e;$sizeh\"e; width =\"e;$sizew\"e;>"e;;
echo $new_image;
}Code: Select all
require("e;file1.php"e;);
//this reduces the image
ResizeImage("e;test.gif"e;,50,50);
echo "e;<br>"e;;
//we can increase an image as well
ResizeImage("e;test.gif"e;,50,50);now problem is this here i m giving height and width
now i want to mention one of both either height or width?
can i do tht?
feyd | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]