Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem getting height and width of a picture

Status
Not open for further replies.

pet41

Programmer
Sep 13, 2005
16
NO
Hi

I am going to present a amount of picture and text (a catalog for auction house). I am using stored procedure in MS SQL to get det data. This method is very quick. It seems to that sometimes I am not getting any information about picture height and width. Here is the way i do it:

function formatPic(pic,sID){
var Img=new Image;
var iWidth;
var iHeight;

Img.src=pic;
iWidth=Img.width;
iHeight=Img.height;

return '<input type="image" id=' + pic + ' src=' + Img.src + ' width="' + iWidth / '5' + 'height="' + iHeight / '5' + '" border="0" alt="Klikk for Info/bud" onClick="showInfo('+ sID +')">';
}

Is there a better way?

Rune
 
I was not able to get it work right. I have to get the height and width "on the fly" looping throug a recordset. When I put a random paramter behinde the file name, I didn't get anything at all. The problem, as you say under FAQ, is deffently caching.

What to do

Rune
 
Hi Dan

It's on the server side. What I am trying to do is to put the picture size on the server, when the picture are copying from the client. I have also develope the client application (auction house)

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top