Include colour table in BMP file size field
This commit is contained in:
parent
3fffb15d4a
commit
563c15be22
|
@ -1 +1 @@
|
||||||
561
|
562
|
||||||
|
|
|
@ -89,7 +89,7 @@ void BMP_Save(uint8_t *data, int width, int height)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rows must be padded to a multiple if 4 bytes
|
// Rows must be padded to a multiple of 4 bytes
|
||||||
int row_size = width / 8;
|
int row_size = width / 8;
|
||||||
int padding_length = (4 - (row_size % 4)) % 4;
|
int padding_length = (4 - (row_size % 4)) % 4;
|
||||||
uint8_t padding_bytes[4] = {0};
|
uint8_t padding_bytes[4] = {0};
|
||||||
|
@ -99,7 +99,7 @@ void BMP_Save(uint8_t *data, int width, int height)
|
||||||
{
|
{
|
||||||
.b = 'B',
|
.b = 'B',
|
||||||
.m = 'M',
|
.m = 'M',
|
||||||
.bitmap_file_size = 14 + 12 + row_size * height,
|
.bitmap_file_size = 14 + 12 + 6 + row_size * height,
|
||||||
.bitmap_data_offset = 14 + 12 + 6
|
.bitmap_data_offset = 14 + 12 + 6
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue