Image Dimensions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MurrayTh

    Image Dimensions

    Is there any way to determine the dimensions of an image using the image's
    URL?
    ie load image based on URL, and then get dimensions? or perhaps better method?
  • MuZZy

    #2
    Re: Image Dimensions

    MurrayTh wrote:[color=blue]
    > Is there any way to determine the dimensions of an image using the image's
    > URL?
    > ie load image based on URL, and then get dimensions? or perhaps better method?[/color]

    I don't think you can get an image parameters until you get it(read - download it)
    I think you can read just the header and then parsing it get the dimentions, but it's gonna be pain
    in the a$$...

    Comment

    • Jon Sagara

      #3
      Re: Image Dimensions

      Using this library, call the GetBitmapFromUr i method to get a Bitmap object,
      which you can use to get the image's dimensions.



      --
      Jon Sagara

      "MurrayTh" <MurrayTh@discu ssions.microsof t.com> wrote in message
      news:4B79CE21-CD64-46A6-8DC0-5EC844907BFF@mi crosoft.com...[color=blue]
      > Is there any way to determine the dimensions of an image using the image's
      > URL?
      > ie load image based on URL, and then get dimensions? or perhaps better[/color]
      method?


      Comment

      • Carl Frisk

        #4
        Re: Image Dimensions

        http doesn't provide the images dimensions. It simply says what size to display the image on the client browser. To
        accurately get the images size you need to get the image local and use the handy System.Drawing. Image class to extract
        whatever info you need. Well most of it anyway.

        --
        ....Carl Frisk
        Anger is a brief madness.
        - Horace, 20 B.C.



        "MurrayTh" <MurrayTh@discu ssions.microsof t.com> wrote in message
        news:4B79CE21-CD64-46A6-8DC0-5EC844907BFF@mi crosoft.com...[color=blue]
        > Is there any way to determine the dimensions of an image using the image's
        > URL?
        > ie load image based on URL, and then get dimensions? or perhaps better method?[/color]

        Comment

        • MurrayTh

          #5
          Re: Image Dimensions

          Carl,

          Is there a way load the image as browser would using http, and use it to get
          the dimensions for an image based on a URL, rather than a local file? The
          images I need to refer to are not local. Would this use a Stream reader or
          something? Not familiar enough with how to get this, as all stream readers
          seem to read a file, not a URL.

          "Carl Frisk" wrote:
          [color=blue]
          > http doesn't provide the images dimensions. It simply says what size to display the image on the client browser. To
          > accurately get the images size you need to get the image local and use the handy System.Drawing. Image class to extract
          > whatever info you need. Well most of it anyway.
          >
          > --
          > ....Carl Frisk
          > Anger is a brief madness.
          > - Horace, 20 B.C.
          > http://www.carlfrisk.com
          >
          >
          > "MurrayTh" <MurrayTh@discu ssions.microsof t.com> wrote in message
          > news:4B79CE21-CD64-46A6-8DC0-5EC844907BFF@mi crosoft.com...[color=green]
          > > Is there any way to determine the dimensions of an image using the image's
          > > URL?
          > > ie load image based on URL, and then get dimensions? or perhaps better method?[/color]
          >
          >[/color]

          Comment

          • Carl Frisk

            #6
            Re: Image Dimensions

            Sorry I missed your reply back there. Just saw it now.

            I would need to know more about the site you are attempting to get the image information from. Does the site actually
            display the image or a thumbnail of the image? .ASP? ASP.NET? The URL won't usually have image data in it, unless you
            have control over the site and can embed it in Meta Data or something like that. Or in a hidden input. Otherwise you
            will have to download the image to get it's internal data.

            --
            ....Carl Frisk
            Anger is a brief madness.
            - Horace, 20 B.C.



            "MurrayTh" <MurrayTh@discu ssions.microsof t.com> wrote in message
            news:A7211953-F161-4C38-9750-652DB5F78311@mi crosoft.com...[color=blue]
            > Carl,
            >
            > Is there a way load the image as browser would using http, and use it to get
            > the dimensions for an image based on a URL, rather than a local file? The
            > images I need to refer to are not local. Would this use a Stream reader or
            > something? Not familiar enough with how to get this, as all stream readers
            > seem to read a file, not a URL.
            >
            > "Carl Frisk" wrote:
            >[color=green]
            >> http doesn't provide the images dimensions. It simply says what size to display the image on the client browser. To
            >> accurately get the images size you need to get the image local and use the handy System.Drawing. Image class to
            >> extract
            >> whatever info you need. Well most of it anyway.
            >>
            >> --
            >> ....Carl Frisk
            >> Anger is a brief madness.
            >> - Horace, 20 B.C.
            >> http://www.carlfrisk.com
            >>
            >>
            >> "MurrayTh" <MurrayTh@discu ssions.microsof t.com> wrote in message
            >> news:4B79CE21-CD64-46A6-8DC0-5EC844907BFF@mi crosoft.com...[color=darkred]
            >> > Is there any way to determine the dimensions of an image using the image's
            >> > URL?
            >> > ie load image based on URL, and then get dimensions? or perhaps better method?[/color]
            >>
            >>[/color][/color]

            Comment

            • Carl Frisk

              #7
              Re: Image Dimensions

              Sorry I missed your reply back there. Just saw it now.

              I would need to know more about the site you are attempting to get the image information from. Does the site actually
              display the image or a thumbnail of the image? .ASP? ASP.NET? The URL won't usually have image data in it, unless you
              have control over the site and can embed it in Meta Data or something like that. Or in a hidden input. Otherwise you
              will have to download the image to get it's internal data.

              --
              ....Carl Frisk
              Anger is a brief madness.
              - Horace, 20 B.C.



              "MurrayTh" <MurrayTh@discu ssions.microsof t.com> wrote in message
              news:A7211953-F161-4C38-9750-652DB5F78311@mi crosoft.com...[color=blue]
              > Carl,
              >
              > Is there a way load the image as browser would using http, and use it to get
              > the dimensions for an image based on a URL, rather than a local file? The
              > images I need to refer to are not local. Would this use a Stream reader or
              > something? Not familiar enough with how to get this, as all stream readers
              > seem to read a file, not a URL.
              >
              > "Carl Frisk" wrote:
              >[color=green]
              >> http doesn't provide the images dimensions. It simply says what size to display the image on the client browser. To
              >> accurately get the images size you need to get the image local and use the handy System.Drawing. Image class to
              >> extract
              >> whatever info you need. Well most of it anyway.
              >>
              >> --
              >> ....Carl Frisk
              >> Anger is a brief madness.
              >> - Horace, 20 B.C.
              >> http://www.carlfrisk.com
              >>
              >>
              >> "MurrayTh" <MurrayTh@discu ssions.microsof t.com> wrote in message
              >> news:4B79CE21-CD64-46A6-8DC0-5EC844907BFF@mi crosoft.com...[color=darkred]
              >> > Is there any way to determine the dimensions of an image using the image's
              >> > URL?
              >> > ie load image based on URL, and then get dimensions? or perhaps better method?[/color]
              >>
              >>[/color][/color]

              Comment

              Working...