From 709a31da93c9677ec6ebb17e780014f6ba8016ff Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 17 Aug 2015 12:37:38 +1000 Subject: Simplify thumbnail blend parser No need to convert the BHead code to an int, just compare the bytes. --- release/bin/blender-thumbnailer.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'release/bin') diff --git a/release/bin/blender-thumbnailer.py b/release/bin/blender-thumbnailer.py index d3b31d63fad..fe5d462bba9 100755 --- a/release/bin/blender-thumbnailer.py +++ b/release/bin/blender-thumbnailer.py @@ -88,9 +88,8 @@ def blend_extract_thumb(path): import os open_wrapper = open_wrapper_get() - # def MAKE_ID(tag): ord(tag[0])<<24 | ord(tag[1])<<16 | ord(tag[2])<<8 | ord(tag[3]) - REND = 1145980242 # MAKE_ID(b'REND') - TEST = 1414743380 # MAKE_ID(b'TEST') + REND = b'REND' + TEST = b'TEST' blendfile = open_wrapper(path, 'rb') @@ -116,7 +115,8 @@ def blend_extract_thumb(path): return None, 0, 0 sizeof_bhead = 24 if is_64_bit else 20 - int_endian_pair = '>ii' if is_big_endian else '