diff --git a/man/feh.pre b/man/feh.pre index 8be5a6fc..83df165d 100644 --- a/man/feh.pre +++ b/man/feh.pre @@ -264,6 +264,14 @@ Automatic reload is not supported in montage, index, or thumbnail mode. Automatically rotate images based on EXIF data. Does not alter the image files. . +.It Cm --rotate Ar 0 | Ar 90 | Ar 180 | Ar 270 +. +Rotate each image +.Ar degrees +clockwise after loading it. +. +.Pp +. .It Cm -Z , --auto-zoom . Zoom pictures to screen size in fullscreen / fixed geometry mode. diff --git a/src/imlib.c b/src/imlib.c index fc81bdd2..5dd8afa0 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -479,6 +479,8 @@ int feh_load_image(Imlib_Image * im, feh_file * file) gib_imlib_image_orientate(*im, 3); #endif + gib_imlib_image_orientate(*im, opt.rotate); + D(("Loaded ok\n")); return(1); } diff --git a/src/options.c b/src/options.c index a77c1632..7ff04271 100644 --- a/src/options.c +++ b/src/options.c @@ -437,6 +437,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) {"class" , 1, 0, OPTION_class}, {"no-conversion-cache", 0, 0, OPTION_no_conversion_cache}, {"window-id", 1, 0, OPTION_window_id}, + {"rotate", 1, 0, OPTION_rotate}, {0, 0, 0, 0} }; int optch = 0, cmdx = 0; @@ -849,6 +850,9 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) opt.zoom_rate = 1 + ((float)opt.zoom_rate / 100); } break; + case OPTION_rotate: + opt.rotate = atoi(optarg) / 90 % 4; + break; default: break; } diff --git a/src/options.h b/src/options.h index 6441e8bc..3d6b89ac 100644 --- a/src/options.h +++ b/src/options.h @@ -128,6 +128,7 @@ struct __fehoptions { int default_zoom; int zoom_mode; double zoom_rate; + int rotate; unsigned char adjust_reload; int xinerama_index; char *x11_class; @@ -254,6 +255,7 @@ OPTION_auto_reload, OPTION_class, OPTION_no_conversion_cache, OPTION_window_id, +OPTION_rotate, }; //typedef enum __fehoption fehoption;