8000 driver/js/imagetools.py fix · wired8/lv_binding_micropython@f165780 · GitHub
[go: up one dir, main page]

Skip to content

Commit f165780

Browse files
committed
driver/js/imagetools.py fix
Apply 176e93b fix to driver/js/imagetools.py
1 parent 176e93b commit f165780

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

driver/js/imagetools.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ def get_png_info(decoder, src, header):
3838
if lv.img.src_get_type(src) != lv.img.SRC.VARIABLE:
3939
return lv.RES.INV
4040

41-
png_header = bytes(lv.img_dsc_t.__cast__(src).data.__dereference__(24))
41+
data = lv.img_dsc_t.__cast__(src).data
42+
if data == None:
43+
return lv.RES.INV
44+
45+
png_header = bytes(data.__dereference__(24))
4246

4347
if png_header.startswith(b'\211PNG\r\n\032\n'):
4448
if png_header[12:16] == b'IHDR':

0 commit comments

Comments
 (0)
0