shared-librarieslibjpeg

Wrong libjpeg version in zathura develop branch


Version:

$ zathura --version
zathura 0.5.2
girara 0.3.7 (runtime: 0.3.9)
(plugin) pdf-mupdf (0.4.0) (/usr/lib/zathura/libpdf-mupdf.so)

I'm using ArchLinux and Zathura-develop. However, Zathura of develop branch requires libjpeg9 to render jpeg in PDF correctly. When I open a PDF file with zathura in terminal , all JPG pictures are rendered black and zathura says:

$ zathura -l debug file.pdf
debug: ../girara/template.c:311: base_changed(): Variable 'session' not set.
debug: ../zathura/plugin.c:279: register_plugin(): plugin: filetype mapping added: application/pdf
debug: ../zathura/plugin.c:279: register_plugin(): plugin: filetype mapping added: application/oxps
debug: ../zathura/plugin.c:279: register_plugin(): plugin: filetype mapping added: application/epub+zip
debug: ../zathura/plugin.c:279: register_plugin(): plugin: filetype mapping added: application/x-fictionbook+xml
debug: ../zathura/plugin.c:279: register_plugin(): plugin: filetype mapping added: application/xml
debug: ../zathura/plugin.c:173: load_plugin(): Successfully loaded plugin from '/usr/lib/zathura/libpdf-mupdf.so'.
debug: ../zathura/plugin.c:174: load_plugin(): plugin pdf-mupdf: version 0.4.0
debug: ../girara/config.c:373: girara_config_parse(): reading configuration file '/etc/xdg/zathurarc'
debug: ../girara/config.c:270: config_parse(): failed to open config file '/etc/xdg/zathurarc'
debug: ../girara/config.c:373: girara_config_parse(): reading configuration file '/etc/zathurarc'
debug: ../girara/config.c:270: config_parse(): failed to open config file '/etc/zathurarc'
debug: ../girara/config.c:373: girara_config_parse(): reading configuration file '/home/rqdmap/.config/zathura/zathurarc'
debug: ../zathura/zathura.c:447: zathura_init(): Sandbox deactivated.
debug: ../girara/session.c:935: girara_set_window_icon(): Loading window icon with name: org.pwmt.zathura
debug: ../zathura/zathura.c:374: init_database(): Using plain database backend.
debug: ../zathura/zathura.c:203: zathura_update_view_ppi(): monitor width: 673 mm, pixels: 2560, ppi: 96.62
debug: ../zathura/zathura.c:203: zathura_update_view_ppi(): monitor width: 673 mm, pixels: 2560, ppi: 96.62
debug: ../zathura/dbus-interface.c:105: bus_acquired(): Bus acquired at 'org.pwmt.zathura.PID-8086'.
debug: ../zathura/zathura.c:203: zathura_update_view_ppi(): monitor width: 673 mm, pixels: 2560, ppi: 96.62
debug: ../zathura/dbus-interface.c:132: name_acquired(): Acquired 'org.pwmt.zathura.PID-8086' on session bus.
debug: ../zathura/content-type.c:72: guess_type_magic(): magic detected filetype: application/pdf
debug: ../zathura/file-monitor.c:126: zathura_filemonitor_new(): using glib file monitor
debug: ../zathura/zathura.c:1177: document_open(): starting file monitor
debug: ../zathura/zathura.c:686: setup_renderer(): starting renderer with cache size 15
debug: ../zathura/zathura.c:203: zathura_update_view_ppi(): monitor width: 673 mm, pixels: 2560, ppi: 96.62
debug: ../zathura/render.c:923: render_all(): Queuing resize for page 0 to 574 x 766 (595.28 x 793.70).
debug: ../zathura/render.c:923: render_all(): Queuing resize for page 1 to 574 x 766 (595.28 x 793.70).
debug: ../zathura/render.c:923: render_all(): Queuing resize for page 2 to 574 x 766 (595.28 x 793.70).
debug: ../zathura/render.c:923: render_all(): Queuing resize for page 3 to 574 x 766 (595.28 x 793.70).
debug: ../zathura/render.c:923: render_all(): Queuing resize for page 4 to 574 x 766 (595.28 x 793.70).
debug: ../zathura/render.c:923: render_all(): Queuing resize for page 5 to 574 x 766 (595.28 x 793.70).
debug: ../zathura/render.c:923: render_all(): Queuing resize for page 6 to 574 x 766 (595.28 x 793.70).
debug: ../zathura/render.c:923: render_all(): Queuing resize for page 7 to 574 x 766 (595.28 x 793.70).
debug: ../zathura/render.c:923: render_all(): Queuing resize for page 8 to 574 x 766 (595.28 x 793.70).
debug: ../zathura/callbacks.c:235: cb_widget_screen_changed(): called
debug: ../zathura/zathura.c:1305: document_open(): Failed to load bookmarks.
debug: ../zathura/jumplist.c:160: zathura_jumplist_load(): No jumplist for this file in the database yet
debug: ../zathura/render.c:971: page_cache_is_cached(): Page 1 is a cache miss
debug: ../zathura/render.c:1070: zathura_renderer_page_cache_add(): Page 1 is cached at cache index 0
debug: ../zathura/render.c:971: page_cache_is_cached(): Page 2 is a cache miss
debug: ../zathura/render.c:1070: zathura_renderer_page_cache_add(): Page 2 is cached at cache index 1
debug: ../zathura/render.c:971: page_cache_is_cached(): Page 3 is a cache miss
debug: ../zathura/render.c:1070: zathura_renderer_page_cache_add(): Page 3 is cached at cache index 2
debug: ../zathura/render.c:896: render_job(): Rendering page 3 ...
debug: ../zathura/render.c:896: render_job(): Rendering page 2 ...
debug: ../zathura/render.c:519: emit_completed_signal(): Emitting signal for page 3
debug: ../zathura/render.c:896: render_job(): Rendering page 1 ...
debug: ../zathura/render.c:519: emit_completed_signal(): Emitting signal for page 2
error: jpeg error: Wrong JPEG library version: library is 80, caller expects 90
warning: read error; treating as end of file
warning: padding truncated image
error: jpeg error: Wrong JPEG library version: library is 80, caller expects 90
warning: read error; treating as end of file
warning: padding truncated image
debug: ../zathura/render.c:519: emit_completed_signal(): Emitting signal for page 1

The latest libjpeg package in archlinux is libjpeg8, so I uninstalled libjpeg8 and installed libjpeg9 manually. But somehow zathura needs exactly "libjpeg.so.8" to launch:

$ zathura
zathura: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory

So I linked libjpeg.so.8 to libjpeg.so.9 manually. But zathura throwed error again:

$ zathura
zathura: /usr/lib/libjpeg.so.8: version `LIBJPEG_8.0' not found (required by /usr/lib/libgdk_pixbuf-2.0.so.0)
zathura: /usr/lib/libjpeg.so.8: version `LIBJPEG_8.0' not found (required by /usr/lib/libtiff.so.6)

Now I have no ideas how to fix it. I wonder whether it's my fault of configuring zathura incorrectly or it's something wrong in zathura's shared-library management.


Solution

  • After searching through the Internet, I found similar problems had been discussed in archlinux forums long ago: zathura jpeg library error after update and FS#34590 - [mupdf] mupdf-1.2 is building with the wrong libjpeg header

    As discussed above, the libjpeg header which mupdf builds with sets the libjpeg version to 90; while the libjpeg library(libjpeg-turbo) which archlinux ships only support version 80.

    Finally I choose to simply install zathura-git and zathura-pdf-mupdf-git from AUR. These packages have solved the problem properly and fit for archlinux. Since it's somewhat a "BUG" of zathura exactly on archlinux, it's better to install it by AUR packages instead of by source.