aboutsummaryrefslogtreecommitdiffstats
path: root/g10/photoid.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/photoid.c')
-rw-r--r--g10/photoid.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/g10/photoid.c b/g10/photoid.c
index d2a249167..3676d3869 100644
--- a/g10/photoid.c
+++ b/g10/photoid.c
@@ -259,7 +259,8 @@ char *image_type_to_string(byte type,int style)
}
#if !defined(FIXED_PHOTO_VIEWER) && !defined(DISABLE_PHOTO_VIEWER)
-static const char *get_default_photo_command(void)
+static const char *
+get_default_photo_command(void)
{
#if defined(_WIN32)
OSVERSIONINFO osvi;
@@ -278,7 +279,14 @@ static const char *get_default_photo_command(void)
#elif defined(__riscos__)
return "Filer_Run %I";
#else
- return "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin";
+ if(path_access("xloadimage",X_OK)==0)
+ return "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin";
+ else if(path_access("eog",X_OK)==0)
+ return "eog %i";
+ else if(path_access("display",X_OK)==0)
+ return "display -title 'KeyID 0x%k' %i";
+ else
+ return "";
#endif
}
#endif
@@ -316,6 +324,12 @@ void show_photos(const struct user_attribute *attrs,
opt.photo_viewer=get_default_photo_command();
#endif
+ if(!*opt.photo_viewer)
+ {
+ log_info(_("no photo viewer set\n"));
+ goto fail;
+ }
+
/* make command grow */
command=pct_expando(opt.photo_viewer,&args);
if(!command)