Nancy Drew wrote on 28 okt 2004 in
microsoft.public.inetserver.asp.general:
does anybody know of a way to get an image width and height without
using a custom dll? we have aspJPEG on the server, and there are
methods to fetch image width and height with that, but it only works
with JPEG and i need to get dimensions for gif and png, too.
A gif file starts with 6 bytes of header containing something like
Hex 47-49-46-38-39-61
this is the string: "GIF89a"
Then follow 4 bytes [nr 7 to 10], say 17-04-ec-02
Hex 0417 = decimal 1047 pixels width
Hex 02ec = decimal 748 pixels height
reading the file serverside in a byte stream
and parsing these first 10 bytes must give you the picture size.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)