473,545 Members | 1,310 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Obtaining Width and Height for an Image

I am having a problem here. I have an ASP page which
displays different images according to the querystring and
the images are all of different sizes. However, in some
browsers the image overlaps with the text next to it
occasionally.

I guess by specifying the "width" and "height" of the
image in the HTML should solve the problem. However, I do
not want to store the width and height of each image in
the database. (There are too many of them!) Is there any
function I can use in my ASP page to obtain the width and
height of an image?

Any help would be very much appreciated!

Jul 19 '05 #1
5 2432
Determining Image Properties through ASP by Mike Shaffer - 5/3/2000
http://www.4guysfromrolla.com/webtech/050300-1.shtml

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #2
> I guess by specifying the "width" and "height" of the
image in the HTML should solve the problem. However, I do
not want to store the width and height of each image in
the database. (There are too many of them!) Is there any
function I can use in my ASP page to obtain the width and
height of an image?


Well, if you use a script to store these elements in your database *once*,
you will avoid (at the cost of 8 bytes per row).

I would seriously consider storing the data in the database, rather than
using that processing *every* time you load the image.

See the bottom half of http://www.aspfaq.com/2170
Jul 19 '05 #3
I've used a little DLL called 'BitmapLibrary' to do this and it works a
treat.

http://www.internext.co.za/stefan/bitmapsize/

Chris.

"Sharlet" <nospam@pleas e> wrote in message
news:0c******** *************** *****@phx.gbl.. .
I am having a problem here. I have an ASP page which
displays different images according to the querystring and
the images are all of different sizes. However, in some
browsers the image overlaps with the text next to it
occasionally.

I guess by specifying the "width" and "height" of the
image in the HTML should solve the problem. However, I do
not want to store the width and height of each image in
the database. (There are too many of them!) Is there any
function I can use in my ASP page to obtain the width and
height of an image?

Any help would be very much appreciated!
Jul 19 '05 #4
Thanks all for your suggestions. You learn something new
every day. I thought there might be an easier solution
such as a built-in function to do that. I guess in that
case I'd better put them all in the database. (*sign*)
Jul 19 '05 #5
Why not code it so that it updates the database itself the first time you
request an image?

Best of both worlds! Add new images to your hearts content and just watch
the database populate itself as the web runs.

Chris.

"Sharlet" <nospam@pleas e> wrote in message
news:08******** *************** *****@phx.gbl.. .
Thanks all for your suggestions. You learn something new
every day. I thought there might be an easier solution
such as a built-in function to do that. I guess in that
case I'd better put them all in the database. (*sign*)
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3165
by: Alex Shi | last post by:
In php, is there a way obtain the width of a charactor of a certain font? Alex -- ================================================== Cell Phone Batteries at 30-50%+ off retail prices! http://www.pocellular.com ==================================================
2
7742
by: Stephen Weatherly | last post by:
Could anyone please help me with a problem I am having with my table widths??? If I have 2 images within a td tag, but using CSS relative positioning I position one over the top of the second (I am placing a transparent gif over the top of a normal gif) then the width of my table is large enough to accommodate both images side by side My...
0
1298
by: Lennart Hoglund | last post by:
Uploading an Image to a Server using the method described in the Knowledge Base article Q315832, works fine and smoothly. Obtaining the Image Size using; ImageSize.Text = New FileInfo(ImageFilePath.PostedFile.FileName).Length is also quit easy. However, obtaining the Height and Width in Pixels is difficult. I need this information to...
11
3557
by: Norman L. DeForest | last post by:
Am I misunderstanding the CSS specifications or is Firefox (version 1.0.6) (and Opera) doing the wrong thing? It appears that Firefox 1.0.6 includes the border in width calculations for tables but not in height calculations. Oh, and Opera version 8.02 does the same thing. |<-->| |<-->| <------ border |<------------>| ...
2
6753
by: Robson Carvalho Machado | last post by:
Dear friends, I'm dynamically creating a Hyperlink with spacer.gif as ImageURL that is an 1px transparent image only to determine link position, but as I create this link dynamically I could not set image width. This problem makes my link clickable only on its borders. When viewing HTML source I could see that spacer.gif has no width and...
1
3879
by: comp.lang.php | last post by:
Sorry folks, I'm on a roll!!! I need to calculate the height or width of an image if you change either the width or height and don't change BOTH of them at the same time, this is to "vector" the image. Here is the class method, it obviously doesn't work: /**
8
2429
by: Kentor | last post by:
Hello, I have users that submit images to my website. By default I choose to make the width bigger than the height because usually pictures are taken horizontally... But in some cases people take pictures vertically so what I'm getting at is... can I know whether an image was taken horizontally or vertically so I can make the proper width/...
2
13407
by: Atul | last post by:
I am unable to find image height and width in mozilla firefox. My code is working in IE but not in Mozilla. How can i find image width and height in mozilla? function check(sel) { if(sel != "") { document.getElementById('newImg').src = sel; document.getElementById('newImgDiv').style.visibility = "visible"; } }
1
4178
epots9
by: epots9 | last post by:
I have a image inside of a div <div id="image"> <div id="loader"> <img id="loaderImage" src="assets/loader.gif" alt="loading..." /> </div> <div id="loaded"> <img id="picture" src="" alt="" /><!--image in question--> <div id="closeAll" onclick="closeAll();">X</div> </div>
0
7457
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7391
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7802
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7746
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5320
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4941
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1869
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1010
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
693
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.