function drawimage(imgd){ var image=new image(); image.src=imgd.src; if(image.width>0 && image.height>0){ flag=true; if(image.width/image.height>= 60/100){ if(image.width>60){ imgd.width=100; imgd.height=(image.height*100)/image.width; }else{ imgd.width=image.width; imgd.height=image.height; } } else{ if(image.height>100){ imgd.height=100; imgd.width=(image.width*100)/image.height; }else{ imgd.width=image.width; imgd.height=image.height; } } } /*else{ imgd.src=""; imgd.alt="" }*/ } | |