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")
|
img_tmp_path = os.path.join(g.tmp_path, my_wxid, "img")
|
||||||
original_img_path = os.path.join(wx_path, img_path)
|
original_img_path = os.path.join(wx_path, img_path)
|
||||||
if os.path.exists(original_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]))
|
imgsavepath = os.path.join(img_tmp_path, img_path + "_" + ".".join([md5, fomt]))
|
||||||
if not os.path.exists(os.path.dirname(imgsavepath)):
|
if not os.path.exists(os.path.dirname(imgsavepath)):
|
||||||
os.makedirs(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进行向量化的异或解密操作
|
out_bytes = np.bitwise_xor(input_bytes, t) # 使用NumPy进行向量化的异或解密操作
|
||||||
md5 = get_md5(out_bytes)
|
md5 = get_md5(out_bytes)
|
||||||
return fomt, md5, out_bytes
|
return False, fomt, md5, out_bytes
|
||||||
return False
|
return False, False, False, False
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -185,8 +185,8 @@ def dat2img(input_data):
|
|||||||
newByte = nowByte ^ t # 异或解密
|
newByte = nowByte ^ t # 异或解密
|
||||||
out_bytes.append(newByte)
|
out_bytes.append(newByte)
|
||||||
md5 = get_md5(out_bytes)
|
md5 = get_md5(out_bytes)
|
||||||
return fomt, md5, out_bytes
|
return True, fomt, md5, out_bytes
|
||||||
return False
|
return False, False, False, False
|
||||||
|
|
||||||
|
|
||||||
def xml2dict(xml_string):
|
def xml2dict(xml_string):
|
||||||
|
Loading…
Reference in New Issue
Block a user