emacs-eaf / eaf-pdf-viewer

Fastest PDF Viewer in Emacs
GNU General Public License v3.0
76 stars 25 forks source link

Exception: Unrecognised args for constructing Pixmap #124

Closed Elonisme closed 9 months ago

Elonisme commented 9 months ago

Describe the bug EAF-pdf-viewer显示白板,查看eaf buffer后显示如下信息:

QApplication: invalid style override 'kvantum' passed, ignoring it. Available styles: Windows, Fusion Traceback (most recent call last): File "/home/elon/emacs-application-framework/app/pdf-viewer/eaf_pdf_widget.py", line 499, in paintEvent self.draw_scroll_pages(painter) File "/home/elon/emacs-application-framework/app/pdf-viewer/eaf_pdf_widget.py", line 559, in draw_scrollpages (, _, page_render_height) = self.get_page_render_info(self.start_page_index) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/elon/emacs-application-framework/app/pdf-viewer/eaf_pdf_widget.py", line 411, in get_page_render_info qpixmap = self.get_page_pixmap(index, self.scale * hidpi_scale_factor, self.rotation) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/elon/emacs-application-framework/app/pdf-viewer/eaf_pdf_widget.py", line 396, in get_page_pixmap qpixmap = page.get_qpixmap(scale, self.get_inverted_mode(), self.inverted_image_mode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/elon/emacs-application-framework/app/pdf-viewer/eaf_pdf_page.py", line 195, in get_qpixmap pixmap = self.make_background_transparent(pixmap, (255,255,255)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/elon/emacs-application-framework/app/pdf-viewer/eaf_pdf_page.py", line 260, in make_background_transparent pixalpha = fitz.Pixmap(None, pixmap) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/elon/.local/lib/python3.11/site-packages/fitz/init.py", line 9690, in init raise Exception( text) Exception: Unrecognised args for constructing Pixmap: <class 'NoneType'>: None <class 'fitz.Pixmap'>: Pixmap(DeviceRGB, (0, 0, 656, 928), 1)

Process eaf aborted (core dumped)

查询资料后发现是pymupdf依赖没有安装好,于是使用pip命令加--break-system-packages强制卸载pymupdf和fitz,然后按照同样强制pip重装fitz和pymupdf,安装顺序为先fitz然后再安装pymupdf,但是问题依然没有得到解决。

我使用arco linux,emacs为29,python版本为3.11

Screenshot_20240129_121056 Screenshot_20240129_121111

metaescape commented 9 months ago

pip install pymupdf==1.21.0 试试,或者其他比如 1.20.0 版本都试一下

Elonisme commented 9 months ago

pip install pymupdf==1.21.0 试试,或者其他比如 1.20.0 版本都试一下

使用命令:

sudo pacman -R python-pymupdf 
sudo pip install pymupdf==1.21.0 --break-system-packages

问题解决

Elonisme commented 9 months ago

使用命令:

sudo pacman -R python-pymupdf 
sudo pip install pymupdf==1.21.0 --break-system-packages

问题解决 Screenshot_20240129_205533