summaryrefslogtreecommitdiff
path: root/src/slideshow.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-11-18 20:22:14 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-11-18 20:22:14 +0100
commit05ab8b3318c187c26205a6d5c0d7e6295d252b94 (patch)
tree42c38187539a50a2027e6482da53389f6d9720d1 /src/slideshow.c
parent60d3bcfdb3370730babe5e75ae8fbdaae9f09a35 (diff)
parentddf90e154a33a4e15054d962124f381eb3608fa2 (diff)
Merge branch 'Ferada-output-directory-for-image-saving'
Diffstat (limited to 'src/slideshow.c')
-rw-r--r--src/slideshow.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/slideshow.c b/src/slideshow.c
index b404318..145bee1 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -615,16 +615,24 @@ void slideshow_save_image(winwidget win)
{
char *tmpname;
Imlib_Load_Error err;
+ char *base_dir = "";
+ if (opt.output_dir) {
+ base_dir = estrjoin("", 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");
+ }
+
+ if (opt.output_dir) {
+ free(base_dir);
}
if (opt.verbose)