summaryrefslogtreecommitdiff
path: root/src/slideshow.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-11-18 20:11:29 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-11-18 20:11:29 +0100
commit34cda90a2520c6b2049f5639655edad7c014d9f2 (patch)
tree9150bb0b538191d728ac1631879c615d7e8871c0 /src/slideshow.c
parent60d3bcfdb3370730babe5e75ae8fbdaae9f09a35 (diff)
parent6bdf2eef44b667298aa8f7bd61aa59e59050f588 (diff)
Merge branch 'output-directory-for-image-saving' of https://github.com/Ferada/feh into Ferada-output-directory-for-image-saving
Diffstat (limited to 'src/slideshow.c')
-rw-r--r--src/slideshow.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/slideshow.c b/src/slideshow.c
index b404318..19aeaee 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -615,18 +615,21 @@ void slideshow_save_image(winwidget win)
{
char *tmpname;
Imlib_Load_Error err;
+ char *base_dir = estrjoin("", opt.output_dir ? opt.output_dir : "", "/", NULL);
if (win->file) {
- tmpname = feh_unique_filename("", FEH_FILE(win->file->data)->name);
+ tmpname = feh_unique_filename(base_dir, FEH_FILE(win->file->data)->name);
} else if (mode) {
char *tmp;
tmp = estrjoin(".", mode, "png", NULL);
- tmpname = feh_unique_filename("", tmp);
+ tmpname = feh_unique_filename(base_dir, tmp);
free(tmp);
} else {
- tmpname = feh_unique_filename("", "noname.png");
+ tmpname = feh_unique_filename(base_dir, "noname.png");
}
+ free(base_dir);
+
if (opt.verbose)
fprintf(stderr, "saving image to filename '%s'\n", tmpname);