diff options
-rw-r--r-- | man/feh.pre | 2 | ||||
-rw-r--r-- | src/slideshow.c | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/man/feh.pre b/man/feh.pre index f65ccd2..2587501 100644 --- a/man/feh.pre +++ b/man/feh.pre @@ -589,7 +589,7 @@ image. . Save files to .Ar directory -.Pq only useful with -k . +.Pq only useful with -k , -o / -O or the save_image command . By default, files are saved in the current working directory. . .It Cm -p , --preload diff --git a/src/slideshow.c b/src/slideshow.c index 3770677..63c0a11 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); |