Is it possible to get image size before/without downloading?

2006-07-22 Thread aldonnelley
Hi there: a bit of a left-field question, I think. I'm writing a program that analyses image files downloaded with a basic crawler, and it's slow, mainly because I only want to analyse files within a certain size range, and I'm having to download all the files on the page, open them, get their

Re: Is it possible to get image size before/without downloading?

2006-07-22 Thread Josiah Manson
In the head of an HTTP response, most servers will specify a Content-Length that is the number of bytes in the body of the response. Normally, when using the GET method, the header is returned with the body following. It is possible to make a HEAD request to the server that will only return header

Re: Is it possible to get image size before/without downloading?

2006-07-22 Thread aldonnelley
Thanks Josiah I thought as much... Still, it'll help me immensely to cut the downloads from a page to only those that are within a file-size range, even if this gets me some images that are out-of-spec dimensionally. Cheers, Al. (Oh, and if anyone still has a bright idea about how to get image

Re: Is it possible to get image size before/without downloading?

2006-07-22 Thread Peter Otten
[EMAIL PROTECTED] wrote: Hi there: a bit of a left-field question, I think. I'm writing a program that analyses image files downloaded with a basic crawler, and it's slow, mainly because I only want to analyse files within a certain size range, and I'm having to download all the files on the

Re: Is it possible to get image size before/without downloading?

2006-07-22 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], aldonnelley wrote: (Oh, and if anyone still has a bright idea about how to get image dimensions without downloading, it'd be great to hear!) Most image formats have some sort of header with the dimensions information so it's enough to download this header. Depends on the