Calculate height and width of GIF/JPG files(5) header = Input(2, f) ' Next two bytes are the marker length wHi = Asc(Midbp(header, 1, 1)) wLo = Asc(Midbp(header, 2, 1)) w = wHi * 256 + wLo header = Input(w-2, f) ' Skip over that many bytes (minus the 2 byte length already read) w = 0 ' Clear the variable End If Wend' Continue until the marker is found End If' Ends the check to see if the file starts with FF D8 EndOfFile: If Err <> 0 Then Err = 0 Resume AfterError End If End If' Ends the check to see if the format is GIF or JPG