Archlinux的官方extra/imv不支持gif文件查看,

extra/imv 4.5.0-4
    Image viewer for Wayland and X11

archlinuxcn/imv-lily 4.5.0-7 [已安装]
    Image viewer for Wayland and X11 (with lilydjwg's patches)

本身imv是支持的,前提是依赖libnsgif库,但它要求libnsgif版本< 1.0.0,但当前最新版本是1.0.0,所以官包打不上这个依赖,没办法带上libnsgif,从而不支持gif查看。而且这个库从0.2.1到1.0.0有很多不兼容变更:

  • 头文件从libnsgif.h改为nsgif.h,diff
  • 头文件暴露的接口,结构体全部换名字,有的还给删掉了,这直接让之前用这个库的人懵了,diff1, diff2

解决办法有二:

  1. 自己下载imv源码,机器上将libnsgif库降级为0.2.1版本,自行编译
  2. 使用依云改过的包archlinuxcn/imv-lily,亲测可以查看gif文件

PS:可使用imv -h查看当前编译信息是否带了libnsgif支持,如下是我自己编译带了libnsgif支持的。

./imv-x11 -h
imv v4.5.0
See manual for usage information.
This version of imv has been compiled with the following backends:

Name: FreeImage
Description: Open source image library supporting a large number of formats
Website: http://freeimage.sourceforge.net/
License: FreeImage Public License v1.0

Name: libtiff
Description: The de-facto tiff library
Website: http://www.libtiff.org/
License: MIT

Name: libpng
Description: The official PNG reference implementation
Website: http://www.libpng.org/pub/png/libpng.html
License: The libpng license

Name: libjpeg-turbo
Description: Fast JPEG codec based on libjpeg. This software is based in part on the work of the Independent JPEG Group.
Website: https://libjpeg-turbo.org/
License: The Modified BSD License

Name: libRSVG
Description: SVG library developed by GNOME
Website: https://wiki.gnome.org/Projects/LibRsvg
License: GNU Lesser General Public License v2.1+

Name: libnsgif
Description: Tiny GIF decoding library from the NetSurf project
Website: https://www.netsurf-browser.org/projects/libnsgif/
License: MIT

Name: libheif
Description: ISO/IEC 23008-12:2017 HEIF file format decoder and encoder.
Website: http://www.libheif.org
License: GNU Lesser General Public License

Name: libjxl
Description: The official JPEGXL reference implementation
Website: https://jpeg.org/jpegxl/
License: The Modified BSD License

imv's full source code is published under the terms of the MIT
license, and can be found at https://sr.ht/~exec64/imv

imv uses the inih library to parse ini files.
See https://github.com/benhoyt/inih for details.
inih is used under the New (3-clause) BSD license.

PS2:imv官方仓库:https://git.sr.ht/~exec64/imv