<%@page import="com.csc.library.utilities.*"%> <html> <head> <title>Show Picture</title> <style type="text/css"> <!-- body { margin-top:10; margin-bottom:0; margin-left:0; margin-right:0; } --> </style> <SCRIPT LANGUAGE="JavaScript"> <!-- /** * function name : resize * description : this function for resize image using aspect ratio method * write by : james * write date : 14-05-2007 * param : * img is input image * variable : * max_width is maximun of output image width * max_height is maximun of output image height * x is output image width * y is output image height */ function resize(img) { var max_width = 300; var max_height = 300; var x; var y; image = new Image(); image.src = img.src; width = image.width; height = image.height; /* old image ratio <= new image ratio */ if((width/height)<= (max_width/max_height)) { x = Math.round((width*max_height)/height); y = max_height; } /* old image ratio > new image ratio */ else { x = max_width; y = Math.round((max_width*height)/width); } img.width = x; img.height = y; //document.getElementById('Layer2').innerText = x +"x" +y; } //--> </SCRIPT> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head> <body> <form name="cscform" method="post" action=""> <table align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="center"><div> <img src="<%=new CheckNull().chkNullString(request.getParameter("pic"),"./UPLOAD/defaultperson.jpg")%>" name="employeePic" width="300" height="300" border="1" id="employeePic" onload="resize(this)" onError="this.src='./UPLOAD/defaultperson.jpg';"> </div></td> </tr> </table> </form> </body> </html>