Get Image width & height without downloading the entire image?

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Dear Sirs,

Is there a way to get the width and height of an image without
downloading the image, or with just downloading a minimal portion of
the image?

For instance, I have a list of 10,000 image urls, and I would like to
get the width and height of every image without spending the time and
bandwidth of downloading every image.

Thanks,
Dave
 
Is there a way to get the width and height of an image without
downloading the image, or with just downloading a minimal portion of
the image?

Hmmm... Possibly. When you make a request to a website for an image, it
will stream down the entire image. I guess you could get just read
enough bytes (depending on the file format) to programatically determine
width/height and then close the stream. I'm not sure if that would
really limit network traffic, or just limit the amount of the traffic
processed by the client.
 
Thank you for the quick response... I think that my code will just
have to download the images until I find a better solution. Thank you
though.

Dave
 
Back
Top