fix 图片读取错误
This commit is contained in:
parent
da7f4bfc5e
commit
ef34c46bfa
@ -374,7 +374,8 @@ def get_img(img_path):
|
||||
img_tmp_path = os.path.join(g.tmp_path, my_wxid, "img")
|
||||
original_img_path = os.path.join(wx_path, img_path)
|
||||
if os.path.exists(original_img_path):
|
||||
fomt, md5, out_bytes = dat2img(original_img_path)
|
||||
rc, fomt, md5, out_bytes = dat2img(original_img_path)
|
||||
|
||||
imgsavepath = os.path.join(img_tmp_path, img_path + "_" + ".".join([md5, fomt]))
|
||||
if not os.path.exists(os.path.dirname(imgsavepath)):
|
||||
os.makedirs(os.path.dirname(imgsavepath))
|
||||
|
@ -170,8 +170,8 @@ def dat2img(input_data):
|
||||
|
||||
out_bytes = np.bitwise_xor(input_bytes, t) # 使用NumPy进行向量化的异或解密操作
|
||||
md5 = get_md5(out_bytes)
|
||||
return fomt, md5, out_bytes
|
||||
return False
|
||||
return False, fomt, md5, out_bytes
|
||||
return False, False, False, False
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
@ -185,8 +185,8 @@ def dat2img(input_data):
|
||||
newByte = nowByte ^ t # 异或解密
|
||||
out_bytes.append(newByte)
|
||||
md5 = get_md5(out_bytes)
|
||||
return fomt, md5, out_bytes
|
||||
return False
|
||||
return True, fomt, md5, out_bytes
|
||||
return False, False, False, False
|
||||
|
||||
|
||||
def xml2dict(xml_string):
|
||||
|
Loading…
Reference in New Issue
Block a user