Ec (2); & lt ;? $Arrgetimagesize("=imagesalbum_01.gif & quot;); echo $ arr [3]; $ strarrexplode (& quot;, $ arr [3]); echo $ strarr [1];? & Gt; & lt; HTML & gt; & lt; HEAD & gt; & lt; TITLE & gt; demo image comparison script ec (2); script
$ 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