<?
$arr=getimagesize("images/album_01.gif");
echo $arr[3];
$strarr=explode(""",$arr[3]);
echo $strarr[1];
?>
<HTML>
<HEAD>
<TITLE>Demo picture scaled down</TITLE>
<script>
function Wa_SetImgAutoSize(img)
{
//var img=document.all.img1;//Get the picture
var MaxWidth=200;//Set the image width limit
var MaxHeight=100;//Set the image height limit
var HeightWidth=img.offsetHeight/img.offsetWidth;//Set the aspect ratio
var WidthHeight=img.offsetWidth/img.offsetHeight;//Set the aspect ratio
alert("test"+img.offsetHeight+img.fileSize);
if(img.offsetHeight>1) alert(img.offsetHeight);
if(img.readyState!="complete"){
return false;//Make sure the image is fully loaded
}
if(img.offsetWidth>MaxWidth){
img.width=MaxWidth;
img.height=MaxWidth*HeightWidth;
}
if(img.offsetHeight>MaxHeight){
img.height=MaxHeight;
img.width=MaxHeight*WidthHeight;
}
}
function CheckImg(img)
{
var message="";
var MaxWidth=1;//Set the image width limit
var MaxHeight=1;//Set the image height limit
if(img.readyState!="complete"){
return false;//Make sure the image is fully loaded
}
if(img.offsetHeight>MaxHeight) message+="rHeight excess:"+img.offsetHeight;
if(img.offsetWidth>MaxWidth) message+="rWidth excess:"+img.offsetWidth;
if(message!="") alert(message);
}
</script>
</HEAD>
<BODY>
<img src="images/frequency.gif" border=0 id="img1" onload="CheckImg(this);">
<br>
<input id=inp type="file" onpropertychange="img1.src=this.value;">
</BODY>
</HTML>