<?
$ Arr = getimagesize ("images/album_01.gif ");
Echo $ arr [3];
$ Strarr = explode ("", $ arr [3]);
Echo $ strarr [1];
?>
<HTML>
<HEAD>
<TITLE> scale down the demo image proportion </TITLE>
<Script>
Function Wa_SetImgAutoSize (img)
{
// Var img = document. all. img1; // obtain the image
Var MaxWidth = 200; // sets the Image Width limit.
Var MaxHeight = 100; // sets the image height limit.
Var HeightWidth = img. offsetHeight/img. offsetWidth; // you can specify 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; // sets the Image Width limit.
Var MaxHeight = 1; // sets the image height limit.
If (img. readyState! = "Complete "){
Return false; // make sure the image is fully loaded.
}
If (img. offsetHeight> MaxHeight) message + = "height excess:" + img. offsetHeight;
If (img. offsetWidth> MaxWidth) message + = "width excess:" + img. offsetWidth;
If (message! = "") Alert (message );
}
</Script>
</HEAD>
<BODY>
<Br>
<Input id = indium type = "file" onpropertychange = "img1.src = this. value;">
</BODY>
</HTML>