I do this exact task myself with an image metadata crawler I wrote. The steps are:
1) Connect to the network socket (S)
2) Turn buffering in the socket off with select(S); $| = 1; select(STDOUT);
3) Send request to server:
$result = eval 'print S "GET /$document HTTP/1.1\nHost: $server_host\n\n"';4) Read <S> up to the end of the HTTP header (and verify that you have the expected Content-type).
5) Call Image::ExifTool::ImageInfo(\*S, {FastScan => 1}) to read the metadata.
ExifTool will only read as much of the file as necessary to obtain the metadata (the FastScan option prevents reading to the end of the image to look for a metadata trailer).
- PhilIn reply to Re: How to download JUST the first X bytes of HTTP response ?
by boardhead
in thread How to download JUST the first X bytes of HTTP response ?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |