mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
scripts/bmpconvert: 8bit bmp file should not convert to 24bit
8bit logo convert to 24bit enlarge triple buffer size which some chips can't reserve. Change-Id: I769602f9d04e46a039d7a9158e25c1bb2067df32 Signed-off-by: Shixiang Zheng <shixiang.zheng@rock-chips.com>
This commit is contained in:
@@ -40,12 +40,6 @@ class BMPFile:
|
||||
if self.biSize > 40:
|
||||
self.read_other(self.biSize-40)
|
||||
|
||||
if self.biBitCount == 8:
|
||||
for i in range(256):
|
||||
self.color_map.append(
|
||||
[unpack("<B", self.file.read(1))[0], unpack("<B", self.file.read(1))[0],
|
||||
unpack("<B", self.file.read(1))[0]])
|
||||
self.file.read(1)
|
||||
if self.biBitCount == 16 and self.biCompression == 3:
|
||||
for i in range(4):
|
||||
self.bf_map.append(
|
||||
@@ -59,14 +53,7 @@ class BMPFile:
|
||||
else:
|
||||
self.bmp16bit_to_24bit()
|
||||
elif self.biBitCount == 8:
|
||||
if self.biCompression == 1:
|
||||
# print("8bit rle file not convert")
|
||||
self.file.close()
|
||||
return
|
||||
elif self.biCompression == 0:
|
||||
self.bmp8bit_to_24bit()
|
||||
else:
|
||||
print("err! bit_count is 8 while bit_compressoion is wrong")
|
||||
# Not convert 8bit bmp logo to 24 bit
|
||||
self.file.close()
|
||||
return
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user