diff --git a/app/DataBase/output_pc.py b/app/DataBase/output_pc.py index 77f0adf..76dc719 100644 --- a/app/DataBase/output_pc.py +++ b/app/DataBase/output_pc.py @@ -890,7 +890,7 @@ const chatMessages = [ if match: continue image_path = hard_link_db.get_image(content=str_content, thumb=False) - image_path = path.get_relative_path(image_path, base_path=f'./data/聊天记录/{self.contact.remark}/image') + image_path = path.get_relative_path(image_path, base_path=f'/data/聊天记录/{self.contact.remark}/image') image_path = image_path.replace('\\', '/') # print(f"tohtml:---{image_path}") if self.is_5_min(timestamp): diff --git a/app/util/dat2pic.py b/app/util/dat2pic.py index 9c7df78..7a36d9c 100644 --- a/app/util/dat2pic.py +++ b/app/util/dat2pic.py @@ -50,14 +50,15 @@ def decode_dat(file_path, out_path): if decode_code == -1: return + filename = os.path.basename(file_path) if file_type == 1: pic_name = os.path.basename(file_path)[:-4] + ".jpg" elif file_type == 3: - pic_name = file_path[:-4] + ".png" + pic_name = filename[:-4] + ".png" elif file_type == 5: - pic_name = file_path[:-4] + ".gif" + pic_name = filename[:-4] + ".gif" else: - pic_name = file_path[:-4] + ".jpg" + pic_name = filename[:-4] + ".jpg" file_outpath = os.path.join(out_path, pic_name) if os.path.exists(file_outpath): return file_outpath