Commit e64ea42f authored by Davis King's avatar Davis King
Browse files

remove dead code

parent 7d8c6a11
...@@ -46,17 +46,11 @@ namespace dlib ...@@ -46,17 +46,11 @@ namespace dlib
int32 biHeight; int32 biHeight;
unsigned short biBitCount; unsigned short biBitCount;
unsigned long biCompression; unsigned long biCompression;
/*
unsigned long biSizeImage;
unsigned long biClrUsed;
unsigned long biClrImportant;
*/
unsigned long a, b, c, d, i; unsigned long a, b, c, d, i;
using namespace std; using namespace std;
streambuf& in = *in_.rdbuf(); streambuf& in = *in_.rdbuf();
// streamsize num;
unsigned char buf[100]; unsigned char buf[100];
...@@ -114,34 +108,10 @@ namespace dlib ...@@ -114,34 +108,10 @@ namespace dlib
a = buf[i]; b = buf[i+1]; c = buf[i+2]; d = buf[i+3]; a = buf[i]; b = buf[i+1]; c = buf[i+2]; d = buf[i+3];
biCompression = a | (b<<8) | (c<<16) | (d<<24); 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) if (biSize != 40)
throw image_load_error("bmp load error 6: header too small"); 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<char*>(buf),biSize-40) != static_cast<long>(biSize - 40))
{
throw image_load_error("bmp load error 7: header too small");
}
bytes_read_so_far += biSize-40;
}
image.set_size(biHeight, biWidth); image.set_size(biHeight, biWidth);
switch (biBitCount) switch (biBitCount)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment