Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Irfanview on Linux

Overview

Irfanview is a fantastic image viewer and batch utility for the Windows platform. But did you know that you can run Irfanview on GNU/Linux, and this post will show you how to do that. There is a caveat, though: Irfanview is not open source. It's freeware. That might turn off some people, but I still choose to use it. It's unparalleled in the GNU world. There are several ways to get Irfanview on a GNU/Linux system, and they all use Wine.

Installing Irfanview with Winetricks

Winetricks is a fancy helper script that makes repetitive tasks in wine easier. It has an option built-in for installing Irfanview. It's a piece of cake. Make sure you have wine with your package manager. dnf install wine Then download winetricks from the link above and run the install irfanview command. ./winetricks -q irfanview The -q is for unattended install. If you want to adjust the settings, run it without the -q. Observe that winetricks mentions installing mfc42.dll for you. That is needed for the installer only.

Installing Irfanview with a custom-rolled package

You can choose to install Irfanview by assembling a package from the rpm spec and debian control scripts I've assembled at https://gitlab.com/bgstack15/irfan. git pull https://gitlab.com/bgstack15/irfan.git What is in the git repository is the source for just the packaging. The actual software source code is downloaded from official web sources upon building the rpm, and upon the installation of the dpkg file. As I said above, the software itself is freeware, so the source is not available for distribution. A wrapper for rpmbuild and dpkg-deb is provided, as usr/share/irfan/build/pack. Run ./pack rpm or ./pack deb and the system will build you the type of package you specified, provided you have the rpm-build or dpkg-dev package. For the rpm, you might need to generate some directories: mkdir -p ~/rpmbuild/SOURCES ~/rpmbuild/SPECS ~/rpmbuild/RPMS ~/rpmbuild/BUILD ~/rpmbuild/BUILDROOT In fact, you should run all this, which will download from gitlab for you the package source. mkdir -p ~/rpmbuild/SOURCES ~/rpmbuild/SPECS ~/rpmbuild/RPMS ~/rpmbuild/BUILD ~/rpmbuild/BUILDROOT cd ~/rpmbuild/SOURCES mkdir irfan-4.44-1; cd irfan-4.44-1 git init git pull https://gitlab.com/bgstack15/irfan.git cd irfan-4.44-1 usr/share/irfan/inc/pack rpm The generated rpm will appear in ~/rpmbuild/RPMS/noarch. Then you can run dnf install ./irfan-4.44-1.noarch.rpm.

The benefits of rolling your own package

The package provided on gitlab includes a menu shortcut to Irfanview, as well as mimetype defaults for jpg and png. You will be able to see Irfanview in the list of applications when you select a file in the file manager, right click, and select "Open with..." The winetricks option does not include that.

Reference

  1. Main irfanview site http://www.irfanview.info/
  2. http://www.boekhoff.info/?pid=linux&tip=install-irfan-view-on-linux
  3. Main wine site https://www.winehq.org/
  4. Latest winetricks script https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
  5. Irfan rpm and deb package source https://gitlab.com/bgstack15/irfan

Comments