#author("2023-12-02T17:05:19+09:00","default:honma","honma") #author("2023-12-02T17:12:57+09:00","default:honma","honma") * Mcomixでavif形式をサポート [#jd7168b8] Mcomixでavif形式が読めるというQiitaの記事があったので挑戦。~ 作業はDebian 12(Bookworm)をインストールした Miix 2 8で実施。 まずは、python のバージョン確認 $ python3 -V Python 3.11.2 mcomix のインストール $ sudo apt install mcomix インストールした mcomix のバージョン確認 $ apt-show-versions mcomix mcomix:all/bookworm 2.1.0-2 uptodate もし、apt-show-versions が未インストールなら $ sudo apt install apt-show-versions AVIF形式のコンテンツが見たいので pip3 で pillow-avif-plugin をインストール~ まずは $ sudo apt install python3-pip pillow-avif-plugin のインストール $ pip3 install pillow-avif-plugin error: externally-managed-environment × This environment is externally managed mq> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed. If you wish to install a non-Debian packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you. Make sure you have pipx installed. See /usr/share/doc/python3.11/README.venv for more information. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of brea king your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. ** error: externally-managed-environment の対策 [#n34c4de9] pip.conf を使用してエラーを回避 $ mkdir -p ~/.config/pip $ nano ~/.config/pip/pip.conf pip.conf には [global] break-system-packages = true を記述。 再度、pillow-avif-plugin のインストール $ pip3 install pillow-avif-plugin image_tools.py で pillow_avi を import すれば良いらしいので $ dpkg -L mcomix | grep image_tools.py /usr/lib/python3/dist-packages/mcomix/image_tools.py 下記のように修正 $ diff -u /usr/lib/python3/dist-packages/mcomix/image_tools.py.orig /usr/lib/python3/dist-packages/mcomix/image_tools.py --- /usr/lib/python3/dist-packages/mcomix/image_tools.py.orig 2022-12-17 21:43:25.000000000 +0900 +++ /usr/lib/python3/dist-packages/mcomix/image_tools.py 2023-12-02 16:39:34.547218777 +0900 @@ -3,6 +3,7 @@ import operator from gi.repository import GLib, GdkPixbuf, Gdk, Gtk import PIL +import pillow_avif from PIL import Image from PIL import ImageEnhance from PIL import ImageOps これで完了 ** 参考 [#ec6910dc] [[Mcomixでavif形式をサポート:https://qiita.com/mimaburao/items/d48c4340ce7947b81b7e]] #htmlinsert(amazon_pc.html);