Obtaining Width and Height for an Image

Discussion in 'ASP General' started by Sharlet, Aug 7, 2003.

  1. Sharlet

    Sharlet Guest

    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!
     
    Sharlet, Aug 7, 2003
    #1
    1. Advertising

  2. Sharlet

    Bullschmidt Guest

    Bullschmidt, Aug 7, 2003
    #2
    1. Advertising

  3. > 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
     
    Aaron Bertrand - MVP, Aug 7, 2003
    #3
  4. Sharlet

    Chris Barber Guest

    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@please> wrote in message
    news:0caf01c35cba$2ea47c70$...
    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!
     
    Chris Barber, Aug 7, 2003
    #4
  5. Sharlet

    Sharlet Guest

    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*)
     
    Sharlet, Aug 8, 2003
    #5
  6. Sharlet

    Chris Barber Guest

    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@please> wrote in message
    news:082d01c35d94$21089760$...
    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*)
     
    Chris Barber, Aug 8, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sean Jorden
    Replies:
    1
    Views:
    608
    laurie
    Aug 19, 2003
  2. Lois
    Replies:
    1
    Views:
    3,305
    Ryan Stewart
    Dec 27, 2004
  3. cera
    Replies:
    1
    Views:
    1,299
    Neredbojias
    Aug 18, 2007
  4. Bernd Meier
    Replies:
    6
    Views:
    529
    GTalbot
    Jan 14, 2008
  5. Chris Beall

    Obtaining window height and width

    Chris Beall, Feb 27, 2005, in forum: Javascript
    Replies:
    3
    Views:
    125
Loading...

Share This Page