From 2bb78e54f3c1c35b168c3b20b6c15bcbe1b6806a Mon Sep 17 00:00:00 2001 From: NafisFaysal Date: Sun, 19 Nov 2017 02:00:57 +0600 Subject: [PATCH] add eog support for Ubuntu Image Viewer --- PIL/ImageShow.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/PIL/ImageShow.py b/PIL/ImageShow.py index 686e1b488..2e930819d 100644 --- a/PIL/ImageShow.py +++ b/PIL/ImageShow.py @@ -156,17 +156,20 @@ else: # implementations - # The default Image Viewer of Ubuntu using the command "eog" in the terminal. - # Reference: https://help.gnome.org/users/eog/stable/commandline.html.en - class DisplayViewer(UnixViewer): def get_command_ex(self, file, **options): - command = executable = "display" or "eog" + command = executable = "display" return command, executable + class EogViewer(UnixViewer): + def get_command_ex(self, file, **options): + command = executable = "eog" + return command, executable - if which("display" or "eog"): - register(DisplayViewer) + if which("display"): + register + elif which("eog"): + register(EogViewer) class XVViewer(UnixViewer): def get_command_ex(self, file, title=None, **options):