$height){ $orientation = "landscape"; $divisor = $width / $maxwidth; } else{ $orientation = "portrait"; $divisor = $height / $maxheight; } // calculate the new dimensions $newwidth = round($width / $divisor); $newheight = round($height / $divisor); // return the new dimensions for use $image[width]=$newwidth; $image[height]=$newheight; return ($image); } $maxwidth = 560; // define the maximum width acceptable $maxheight = 440; // define the maximum height acceptable $imagefile = "../agents/18/cds/1422/vr/1.jpg"; // reference to which image to use $image = image_resize($maxwidth, $maxheight, $imagefile); echo $image[width]." X ".$image[height]."
"; echo "

"; ?>