summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOlof-Joachim Frahm <olof@macrolet.net>2018-10-03 00:06:33 +0200
committerOlof-Joachim Frahm <olof@macrolet.net>2018-10-03 00:49:16 +0200
commit6bdf2eef44b667298aa8f7bd61aa59e59050f588 (patch)
tree6b225490a1b5f806257378279c97a0842d25dea9 /src
parenta9d46da64d02561bf2f545b3271575b304eda913 (diff)
Use output directory for image saving command.
Diffstat (limited to 'src')
-rw-r--r--src/slideshow.c9
1 files changed, 6 insertions, 3 deletions
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);