Skip to content
Snippets Groups Projects
Commit 05ab8b33 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Merge branch 'Ferada-output-directory-for-image-saving'

parents 60d3bcfd ddf90e15
No related branches found
No related tags found
No related merge requests found
......@@ -594,7 +594,9 @@ image.
.
Save files to
.Ar directory
.Pq only useful with -k .
when using
.Cm --keep-http
or the save_image command.
By default, files are saved in the current working directory.
.
.It Cm -p , --preload
......
......@@ -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)
......
......@@ -152,6 +152,7 @@ char path_is_url(char *path) {
return 0;
}
/* Note: path must end with a trailing / or be an empty string */
/* free the result please */
char *feh_unique_filename(char *path, char *basename)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment