Closed Fytch closed 1 year ago
Updating Anki could help. Try version 2.1.54
That's unfortunately not a possibility for because another addon I use is only compatible with 2.1.35. FWIW, https://ankiweb.net/shared/info/1151815987 states that the versions 2.1.30-2.1.47 are supported.
another addon I use is only compatible with 2.1.35
Which one? There' s a possibility that it will work if you open its folder and edit meta.json
.
I would actually be glad if I could get rid of Migaku but there's a couple of features (first and foremost the five pitch colors, they really help me remember the pitch accent well) that I haven't seen offered by any other extension. I'll look into it once I get this addon to work.
So now I updated Anki to 2.1.49 (highest version supported my morphman) and I also updated the addon but I'm getting the same error unfortunately:
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 7
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2022-10-07 19:26:42
Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 41, in cmd
File "aqt\webview.py", line 142, in _onCmd
File "aqt\webview.py", line 595, in _onBridgeCmd
File "aqt\editor.py", line 438, in onBridgeCmd
File "aqt\editor.py", line 882, in onPaste
File "C:\Users\Fytch\AppData\Roaming\Anki2\addons21\1151815987\common.py", line 69, in wrapper
return new(args[0], _old=old)
File "C:\Users\Fytch\AppData\Roaming\Anki2\addons21\1151815987\events.py", line 91, in paste_event
w.convert(mime)
File "C:\Users\Fytch\AppData\Roaming\Anki2\addons21\1151815987\utils\webp.py", line 167, in convert
if self.to_webp(tmp_file, self.set_output_filepath()) is False:
File "C:\Users\Fytch\AppData\Roaming\Anki2\addons21\1151815987\utils\webp.py", line 144, in to_webp
stdout = p.communicate()[0]
File "subprocess.py", line 1011, in communicate
File "C:\python\lib\encodings\cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 328: character maps to <undefined>
This error has to do with windows then.
Thanks. Yeah, you were right, it had to do with Windows' WIC and cwebp. I tried to solve it for over an hour but to no avail. In the end, I just rewrote the addon to instead use ImageMagick. It works like a charm now. ImageMagick has the advantage that it also supports AVIF among many other nice formats, making it more future-proof and flexible. I can create a pull request with my changes if somebody is interested. We can also make it so that the backend is selectable with a config entry, if that's in your interest.
Sure, feel free to make a pull request.
@Fytch do you mind sharing your fork? AVIF support would be great!
Can anything be done about this? Sorry about the prehistoric OS. The OS is 64 bit and the libwebp installation is the official Google build.