From 00501c267c8cb5a5f853eb5bb55d619512f9c3a2 Mon Sep 17 00:00:00 2001 From: llama <100429699+iamllama@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:57:31 +0800 Subject: [PATCH] fix copying images with filenames containing reserved chars (#3775) --- qt/aqt/editor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 84b17c9ed..b8a3804d0 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -1105,7 +1105,8 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too # with allowed_suffixes=pics, all non-pics will be rendered as s and won't be included here if not (images := self.mw.col.media.files_in_str(self.note.mid, html)): return None - return os.path.join(self.mw.col.media.dir(), images[0]) + image_path = urllib.parse.unquote(images[0]) + return os.path.join(self.mw.col.media.dir(), image_path) def select_image_from_clipboard_and_occlude(self) -> None: """Set up the mask editor for the image in the clipboard."""