Use php or js to get the image size, height and width. read the text and use php or js to get the image size, height and width .,? $ Arr = getimagesize ("> <LINKhref =" http://www.php100.com//statics/style/headfloor_950_081205.css "type = text/cssrel = sty
$ Arr = getimagesize ("images/album_01.gif ");
Echo $ arr [3];
$ Strarr = explode ("\" ", $ arr [3]);
Echo $ strarr [1];
?>
Scale down demo images
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 + = "\ r height excess:" + img. offsetHeight;
If (img. offsetWidth> MaxWidth) message + = "\ r width exceeded:" + img. offsetWidth;
If (message! = "") Alert (message );
}
Script