Image viewer (xviewer) on Linux Mint crashes on large pictures - set alternative (Nomacs) as preferred application

Written by - 0 comments

Published on September 2nd 2020 - Listed in Linux Multimedia Graphics


When I went through my family pictures from our last vacation (before COVID-19 happened), I was getting frustrated because most of the pictures could not be opened with the default image viewing program (xviewer) on Linux Mint 18.3.

xviewer is by default the preferred application for photos

On Linux Mint 18.3 (yes, not the newest release), xviewer 1.6 is installed:

ck@mintp ~ $ dpkg -l|grep xviewer | awk '{print $1" "$2" "$3}'
ii xviewer 1.6.1+sylvia
ii xviewer-dbg 1.6.1+sylvia
ii xviewer-plugins 1.2.0+serena

It is also by default configured as preferred application for opening photos:

Crash on large (file size) images

Opening a small sized picture (talking about file size), the picture would be shown without a problem. Even a photo with a couple of megabytes (3-4) would open. However whenever a large photo (above 10MB) was opened, Image Viewer (xviewer) would open with a black background and immediately disappear again (all within less than a second). I used peek to record this phenomenon as a gif:

First a smaller sized photo (3.8MB) was opened without a problem. But then the next photo (16.7MB) didn't show up. When watching closely, one can see Image Viewer opening up with a black background and then disappear again.

At the same time of the disappearance of Image Viewer, one particular log file changed:

ck@mintp /var/log $ tail -f apport.log
ERROR: apport (pid 17317) Wed Sep  2 12:03:24 2020: called for pid 17300, signal 6, core limit 0, dump mode 1
ERROR: apport (pid 17317) Wed Sep  2 12:03:24 2020: executable: /usr/bin/xviewer (command line "xviewer /run/user/1000/gvfs/smb-share:server=nas,share=data/Pictures/Florida\ 2019-2020/IMG_20191230_105629.jpg")
ERROR: apport (pid 17317) Wed Sep  2 12:03:24 2020: debug: session gdbus call: (true,)

ERROR: apport (pid 17317) Wed Sep  2 12:03:24 2020: apport: report /var/crash/_usr_bin_xviewer.1000.crash already exists and unseen, doing nothing to avoid disk usage DoS

This confirms: xviewer has crashed.

Note: When no crash report exists, the last log line would be: wrote report /var/crash/_usr_bin_xviewer.1000.crash

By looking at the crash report, I couldn't figure out why the crash happened. But due to the fact that smaller images worked fine and only large images were affected by the crash, my suspicion goes to a problem in memory allocation.

Nomacs: An alternative image viewer

Luckily there are a lot of alternative image viewers / graphic programs available. Nomacs was the first program listed in It's FOSS Top 11 Image Viewers for Ubuntu and other Linux, so I gave it a shot.

Installation couldn't be easier:

ck@mintp /var/log $ sudo apt install nomacs

Now with Nomacs installed, I opened the large photos with Nomacs, using "Open With" in Nemo (default File Explorer in Linux Mint) and finally the photo opened:

Making Nomacs the preferred application for photos

The obvious way to set Nomacs as the new preferred application for photos is to open Menu -> Preferences -> Preferred applications and select Nomacs for Photos:

It is also possible to do this on the command line. The preferred applications are saved on a per-user basis in ~/.config/mimeapps.list. After having selected Nomacs in the Preferred applications window, the following entries appeared in mimeapps.list under both [Added Associations] and [Default Applications]:

image/bmp=nomacs.desktop
image/gif=nomacs.desktop
image/jpeg=nomacs.desktop
image/png=nomacs.desktop
image/x-eps=nomacs.desktop
image/x-ico=nomacs.desktop
image/x-portable-bitmap=nomacs.desktop
image/x-portable-graymap=nomacs.desktop
image/x-portable-pixmap=nomacs.desktop
image/x-xbitmap=nomacs.desktop
image/x-xpixmap=nomacs.desktop


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.