summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--man/feh.pre35
-rw-r--r--src/gib_imlib.c12
-rw-r--r--src/gib_imlib.h2
-rw-r--r--src/gib_list.c2
-rw-r--r--src/imlib.c14
-rw-r--r--src/keyevents.c2
-rw-r--r--src/main.c2
-rw-r--r--src/options.c4
-rw-r--r--src/slideshow.c2
-rw-r--r--src/wallpaper.c2
11 files changed, 73 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 9788afb..78570cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sat, 27 Oct 2018 19:46:48 +0200 Daniel Friesel <derf+feh@finalrewind.org>
+
+* Release v2.28.1
+ * Do not ignore quit signals (SIGTERM, SIGINT, SIGQUIT) during preload
+ * Add missing EXIF orientations 2, 4, 5, and 7 (when built with exif=1,
+ patch by Olof-Joachim Frahm)
+ * Improve randomness on non-glibc systems
+
Mon, 17 Sep 2018 21:17:04 +0200 Daniel Friesel <derf+feh@finalrewind.org>
* Release v2.28
diff --git a/man/feh.pre b/man/feh.pre
index f65ccd2..583e68f 100644
--- a/man/feh.pre
+++ b/man/feh.pre
@@ -688,16 +688,33 @@ in paused mode.
.
.It Cm -S , --sort Ar sort_type
.
-The file list may be sorted according to image parameters.
+Sort file list according to image parameters.
Allowed sort types are: name, filename, dirname, mtime, width, height, pixels,
size, format.
-For sort modes other than name, filename, dirname, or mtime, a preload run will
-be necessary, causing a delay proportional to the number of images in the list.
+For sort modes other than name, filename, dirname, or mtime, a preload run is
+necessary, causing a delay proportional to the number of images in the list.
.
.Pp
.
-The mtime sort mode sorts images by most recently modified.
-To sort by oldest first, reverse the filelist with --reverse.
+.Cm mtime
+starts with the most recently modified image,
+.Cm width , height , pixels
+and
+.Cm size
+start with the smallest.
+Use
+.Cm --reverse
+to sort by oldest or largest first.
+.
+.Pp
+.
+For
+.Cm name , filename ,
+and
+.Cm dirname ,
+you can use
+.Cm --version-sort
+to sort numbers naturally, so that e.g. 10.jpg comes after 2.jpg.
.
.It Cm -| , --start-at Ar filename
.
@@ -781,11 +798,17 @@ output version information and exit.
.It Cm --version-sort
.
.Pq optional feature, $MAN_VERSCMP$ in this build
-Use natural sorting for file and directory names.
+When combined with
+.Cm --sort name , --sort filename ,
+or
+.Cm --sort dirname :
+use natural sorting for file and directory names.
In this mode, filenames are sorted as an ordinary human would expect, e.g.
.Qq 2.jpg
comes before
.Qq 10.jpg .
+Note that this option only has an effect when a sort mode is set using
+.Cm --sort .
.
.It Cm --xinerama-index Ar screen
.
diff --git a/src/gib_imlib.c b/src/gib_imlib.c
index 8f401aa..7858cb7 100644
--- a/src/gib_imlib.c
+++ b/src/gib_imlib.c
@@ -717,3 +717,15 @@ void gib_imlib_image_orientate(Imlib_Image im, int orientation)
imlib_context_set_image(im);
imlib_image_orientate(orientation);
}
+
+void gib_imlib_image_flip_horizontal(Imlib_Image im)
+{
+ imlib_context_set_image(im);
+ imlib_image_flip_horizontal();
+}
+
+void gib_imlib_image_flip_vertical(Imlib_Image im)
+{
+ imlib_context_set_image(im);
+ imlib_image_flip_vertical();
+}
diff --git a/src/gib_imlib.h b/src/gib_imlib.h
index 6a16a0c..07daabe 100644
--- a/src/gib_imlib.h
+++ b/src/gib_imlib.h
@@ -181,6 +181,8 @@ void gib_imlib_parse_color(char *col, int *r, int *g, int *b, int *a);
void gib_imlib_parse_fontpath(char *path);
Imlib_Font gib_imlib_load_font(char *name);
void gib_imlib_image_orientate(Imlib_Image im, int orientation);
+void gib_imlib_image_flip_horizontal(Imlib_Image im);
+void gib_imlib_image_flip_vertical(Imlib_Image im);
#ifdef __cplusplus
}
diff --git a/src/gib_list.c b/src/gib_list.c
index 5384d98..a8ba1dd 100644
--- a/src/gib_list.c
+++ b/src/gib_list.c
@@ -362,7 +362,7 @@ gib_list_randomize(gib_list * list)
}
for (i = 0; i < len - 1; i++)
{
- r = i + rand() / (RAND_MAX / (len - i) + 1 );
+ r = i + random() / (RAND_MAX / (len - i) + 1 );
t = farray[r];
farray[r] = farray[i];
farray[i] = t;
diff --git a/src/imlib.c b/src/imlib.c
index f41cdcd..18547a9 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -294,10 +294,22 @@ int feh_load_image(Imlib_Image * im, feh_file * file)
}
file->ed = exifData;
- if (orientation == 3)
+ if (orientation == 2)
+ gib_imlib_image_flip_horizontal(*im);
+ else if (orientation == 3)
gib_imlib_image_orientate(*im, 2);
+ else if (orientation == 4)
+ gib_imlib_image_flip_vertical(*im);
+ else if (orientation == 5) {
+ gib_imlib_image_orientate(*im, 3);
+ gib_imlib_image_flip_vertical(*im);
+ }
else if (orientation == 6)
gib_imlib_image_orientate(*im, 1);
+ else if (orientation == 7) {
+ gib_imlib_image_orientate(*im, 3);
+ gib_imlib_image_flip_horizontal(*im);
+ }
else if (orientation == 8)
gib_imlib_image_orientate(*im, 3);
#endif
diff --git a/src/keyevents.c b/src/keyevents.c
index 689aebd..43bc82a 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -686,7 +686,7 @@ void feh_event_handle_generic(winwidget winwid, unsigned int state, KeySym keysy
}
else if (feh_is_kp(EVENT_jump_random, state, keysym, button)) {
if (winwid->type == WIN_TYPE_THUMBNAIL)
- feh_thumbnail_select_next(winwid, rand() % (filelist_len - 1));
+ feh_thumbnail_select_next(winwid, random() % (filelist_len - 1));
else
slideshow_change_image(winwid, SLIDE_RAND, 1);
}
diff --git a/src/main.c b/src/main.c
index eff664a..0d1cc4d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -42,7 +42,7 @@ int main(int argc, char **argv)
{
atexit(feh_clean_exit);
- srand(getpid() * time(NULL) % ((unsigned int) -1));
+ srandom(getpid() * time(NULL) % ((unsigned int) -1));
setup_signal_handlers();
init_parse_options(argc, argv);
diff --git a/src/options.c b/src/options.c
index afbfafa..102c186 100644
--- a/src/options.c
+++ b/src/options.c
@@ -889,6 +889,10 @@ static void show_version(void)
"stat64 "
#endif
+#ifdef HAVE_VERSCMP
+ "verscmp "
+#endif
+
#ifdef HAVE_LIBXINERAMA
"xinerama "
#endif
diff --git a/src/slideshow.c b/src/slideshow.c
index 3770677..b404318 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -258,7 +258,7 @@ void slideshow_change_image(winwidget winwid, int change, int render)
case SLIDE_RAND:
if (filelist_len > 1) {
current_file = feh_list_jump(filelist, current_file, FORWARD,
- (rand() % (filelist_len - 1)) + 1);
+ (random() % (filelist_len - 1)) + 1);
change = SLIDE_NEXT;
}
break;
diff --git a/src/wallpaper.c b/src/wallpaper.c
index db14a8c..ef7ecca 100644
--- a/src/wallpaper.c
+++ b/src/wallpaper.c
@@ -252,7 +252,7 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
XGCValues gcval;
GC gc;
char bgname[20];
- int num = (int) rand();
+ int num = (int) random();
char bgfil[4096];
char sendbuf[4096];