From ba64130909689ec1c3d12126ecd9c020714e71e7 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Thu, 31 Jan 2008 08:17:41 +0000 Subject: [PATCH] Fixed image display in email notifications SVN revision: 2016 --- src/elogd.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index a471319c..2a85a43e 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -21948,10 +21948,8 @@ int create_thumbnail(LOGBOOK * lbs, char *file_name) { char str[MAX_PATH_LENGTH], cmd[2*MAX_PATH_LENGTH], thumb_size[256]; - if (!getcfg(lbs->name, "Thumbnail size", thumb_size, sizeof(thumb_size))) { - file_name[0] = 0; + if (!getcfg(lbs->name, "Thumbnail size", thumb_size, sizeof(thumb_size))) return 0; - } if (!chkext(file_name, ".ps") && !chkext(file_name, ".pdf") && !chkext(file_name, ".eps") && !chkext(file_name, ".gif") && !chkext(file_name, ".jpg") && !chkext(file_name, ".jpeg") && @@ -22945,7 +22943,7 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command) if (thumb_status) { rsprintf("\n"); - if (thumb_status == 2) { + if (thumb_status == 2 && !email) { for (i=0 ; ; i++) { strlcpy(str, file_name, sizeof(str)); sprintf(str+strlen(str), "-%d.png", i); @@ -22959,19 +22957,23 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command) break; } } else { - rsprintf("\n", index + 1, ref); - strlcpy(str, ref, sizeof(str)); - strlcat(str, ".png", sizeof(str)); - rsprintf("\"%s\"\n", str, - attachment[index] + 14, attachment[index] + 14); + if (!email) { + rsprintf("\n", index + 1, ref); + strlcpy(str, ref, sizeof(str)); + strlcat(str, ".png", sizeof(str)); + rsprintf("\"%s\"\n", str, + attachment[index] + 14, attachment[index] + 14); + } } rsprintf("\n\n"); } else if (is_image(att)) { - rsprintf("\n"); - rsprintf("\n", index + 1); - rsprintf("\"%s\"\n", ref, attachment[index] + 14, - attachment[index] + 14); - rsprintf("\n\n"); + if (!email) { + rsprintf("\n"); + rsprintf("\n", index + 1); + rsprintf("\"%s\"\n", ref, attachment[index] + 14, + attachment[index] + 14); + rsprintf("\n\n"); + } } else { if (is_ascii(file_name)) { /* display attachment */