Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --rotate=degrees, rotating each image degrees rightward after loading it #609

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions man/feh.pre
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/imlib.c
Expand Up @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions src/options.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions src/options.h
Expand Up @@ -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;
Expand Down Expand Up @@ -254,6 +255,7 @@ OPTION_auto_reload,
OPTION_class,
OPTION_no_conversion_cache,
OPTION_window_id,
OPTION_rotate,
};

//typedef enum __fehoption fehoption;
Expand Down