This is the script I am using to get uploaded image width and height; it is working fine if tested on separate cfm file;
when returned in application environment, it will return imgWidth and imgHeight as 28 and 30, respectively; (28 by 30 are dimensions of the "bad link" image);
the weird part is that image link is NOT bad; the script is executing fine, and I can see the image, but for some reason script will not read the image width and height properly
one more thing: if I click reload in the browser (somethimes once, somethimes 2-3 times), the script will "pick-up" correct image width and height and it will display 125 by 80 or whatever image width and height is
I understand that is very difficult to explain behavior such as this, especially if you don't have the whole thing in front of you, so I am just asking: have anyone had experience similar to this?
If so, I would appriciate just about any imput that will help me understand behavior such as this.
Thanks
<cfif uplInfo NEQ "">
<cfset file = Replace(ListGetAt(uplInfo, "7"
, " ", "", "all"
>
<div id="hiddenImage" style="position:absolute;">
<img src="storage/<cfoutput>#file#</cfoutput>" name="img1">
</div>
<script language="JavaScript">
if (parseInt(navigator.appVersion) >= 4) {
if (navigator.appName == "Netscape"
{isNav = true;}
else {isNav = false;}
}
if (!isNav) {
img = document.all('hiddenImage');
} else {
img = document.layers['hiddenImage'];
}
imgWidth = img.document.images['img1'].width;
imgHeight = img.document.images['img1'].height;
</script>
<cfelse>
<script language="JavaScript">
var imgWidth = 0;
var imgHeight = 0;
</script>
</cfif>
when returned in application environment, it will return imgWidth and imgHeight as 28 and 30, respectively; (28 by 30 are dimensions of the "bad link" image);
the weird part is that image link is NOT bad; the script is executing fine, and I can see the image, but for some reason script will not read the image width and height properly
one more thing: if I click reload in the browser (somethimes once, somethimes 2-3 times), the script will "pick-up" correct image width and height and it will display 125 by 80 or whatever image width and height is
I understand that is very difficult to explain behavior such as this, especially if you don't have the whole thing in front of you, so I am just asking: have anyone had experience similar to this?
If so, I would appriciate just about any imput that will help me understand behavior such as this.
Thanks
<cfif uplInfo NEQ "">
<cfset file = Replace(ListGetAt(uplInfo, "7"
<div id="hiddenImage" style="position:absolute;">
<img src="storage/<cfoutput>#file#</cfoutput>" name="img1">
</div>
<script language="JavaScript">
if (parseInt(navigator.appVersion) >= 4) {
if (navigator.appName == "Netscape"
else {isNav = false;}
}
if (!isNav) {
img = document.all('hiddenImage');
} else {
img = document.layers['hiddenImage'];
}
imgWidth = img.document.images['img1'].width;
imgHeight = img.document.images['img1'].height;
</script>
<cfelse>
<script language="JavaScript">
var imgWidth = 0;
var imgHeight = 0;
</script>
</cfif>