diff --git a/dlib/image_loader/image_loader.h b/dlib/image_loader/image_loader.h index c06eed9ca..e959973f6 100644 --- a/dlib/image_loader/image_loader.h +++ b/dlib/image_loader/image_loader.h @@ -46,17 +46,11 @@ namespace dlib int32 biHeight; unsigned short biBitCount; unsigned long biCompression; - /* - unsigned long biSizeImage; - unsigned long biClrUsed; - unsigned long biClrImportant; - */ unsigned long a, b, c, d, i; using namespace std; streambuf& in = *in_.rdbuf(); - // streamsize num; unsigned char buf[100]; @@ -114,34 +108,10 @@ namespace dlib a = buf[i]; b = buf[i+1]; c = buf[i+2]; d = buf[i+3]; biCompression = a | (b<<8) | (c<<16) | (d<<24); - /* - i += 4; - a = buf[i]; b = buf[i+1]; c = buf[i+2]; d = buf[i+3]; - biSizeImage = a | (b<<8) | (c<<16) | (d<<24); - - i += 4+4+4; - a = buf[i]; b = buf[i+1]; c = buf[i+2]; d = buf[i+3]; - biClrUsed = a | (b<<8) | (c<<16) | (d<<24); - - i += 4; - a = buf[i]; b = buf[i+1]; c = buf[i+2]; d = buf[i+3]; - biClrImportant = a | (b<<8) | (c<<16) | (d<<24); - */ - if (biSize != 40) throw image_load_error("bmp load error 6: header too small"); - // read and discard any extra bytes that are part of the header - if (biSize > 40) - { - if (in.sgetn(reinterpret_cast(buf),biSize-40) != static_cast(biSize - 40)) - { - throw image_load_error("bmp load error 7: header too small"); - } - bytes_read_so_far += biSize-40; - } - image.set_size(biHeight, biWidth); switch (biBitCount)