diff --git a/app/DataBase/exporter_docx.py b/app/DataBase/exporter_docx.py index a718188..3364745 100644 --- a/app/DataBase/exporter_docx.py +++ b/app/DataBase/exporter_docx.py @@ -322,8 +322,8 @@ class DocxExporter(ExporterBase): if message[4]: # is_send continue try: - chatroom_avatar_path = f"{origin_docx_path}/avatar/{message[12].wxid}.png" - message[12].save_avatar(chatroom_avatar_path) + chatroom_avatar_path = f"{origin_docx_path}/avatar/{message[13].wxid}.png" + message[13].save_avatar(chatroom_avatar_path) except: print(message) pass diff --git a/app/DataBase/exporter_html.py b/app/DataBase/exporter_html.py index c6c40c9..d5d7fbf 100644 --- a/app/DataBase/exporter_html.py +++ b/app/DataBase/exporter_html.py @@ -203,6 +203,7 @@ class HtmlExporter(ExporterBase): if video_path is None and image_path is None: return video_path = f'{Me().wx_dir}/{video_path}' + video_path = video_path.replace('\\','/') if os.path.exists(video_path): new_path = origin_docx_path + '/video/' + os.path.basename(video_path) if not os.path.exists(new_path): diff --git a/app/ui/menu/about_dialog.cp310-win_amd64.pyd b/app/ui/menu/about_dialog.cp310-win_amd64.pyd index e8f3e32..9b4f2aa 100644 Binary files a/app/ui/menu/about_dialog.cp310-win_amd64.pyd and b/app/ui/menu/about_dialog.cp310-win_amd64.pyd differ diff --git a/app/ui/menu/about_dialog.cp311-win_amd64.pyd b/app/ui/menu/about_dialog.cp311-win_amd64.pyd index 0b9c318..32f2315 100644 Binary files a/app/ui/menu/about_dialog.cp311-win_amd64.pyd and b/app/ui/menu/about_dialog.cp311-win_amd64.pyd differ diff --git a/app/ui/menu/about_dialog.cp312-win_amd64.pyd b/app/ui/menu/about_dialog.cp312-win_amd64.pyd index 81f95f8..0dd0bbe 100644 Binary files a/app/ui/menu/about_dialog.cp312-win_amd64.pyd and b/app/ui/menu/about_dialog.cp312-win_amd64.pyd differ diff --git a/app/util/image.py b/app/util/image.py index 559d3ac..47796c7 100644 --- a/app/util/image.py +++ b/app/util/image.py @@ -1,5 +1,7 @@ import os +import traceback +from app.log import logger from app.person import Me # 图片字节头信息, @@ -17,19 +19,23 @@ def get_code(dat_read): :param file_path: dat文件路径 :return: 如果文件为jpg/png/gif格式,则返回解密码,否则返回-1 """ - - head_index = 0 - while head_index < len(pic_head): - # 使用第一个头信息字节来计算加密码 - # 第二个字节来验证解密码是否正确 - code = dat_read[0] ^ pic_head[head_index] - idf_code = dat_read[1] ^ code - head_index = head_index + 1 - if idf_code == pic_head[head_index]: - return head_index, code - head_index = head_index + 1 - print("not jpg, png, gif") - return -1, -1 + try: + if not dat_read: + return -1, -1 + head_index = 0 + while head_index < len(pic_head): + # 使用第一个头信息字节来计算加密码 + # 第二个字节来验证解密码是否正确 + code = dat_read[0] ^ pic_head[head_index] + idf_code = dat_read[1] ^ code + head_index = head_index + 1 + if idf_code == pic_head[head_index]: + return head_index, code + head_index = head_index + 1 + print("not jpg, png, gif") + except: + logger.error(f'image解析发生了错误:\n\n{traceback.format_exc()}') + return -1, -1 def decode_dat(file_path, out_path):