From 4eb72706ebd0635d23e96bdde7b6f9612d18d4c5 Mon Sep 17 00:00:00 2001 From: ulteq Date: Wed, 22 Aug 2018 10:56:17 +0200 Subject: Add an option to disable inplace edit --- src/imlib.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/imlib.c') diff --git a/src/imlib.c b/src/imlib.c index f41cdcd..91b635e 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -1192,6 +1192,22 @@ void feh_edit_inplace(winwidget w, int op) if (!w->file || !w->file->data || !FEH_FILE(w->file->data)->filename) return; + if (opt.no_inplace_edit) { + imlib_context_set_image(w->im); + if (op == INPLACE_EDIT_FLIP) + imlib_image_flip_vertical(); + else if (op == INPLACE_EDIT_MIRROR) + imlib_image_flip_horizontal(); + else { + imlib_image_orientate(op); + tmp = w->im_w; + FEH_FILE(w->file->data)->info->width = w->im_w = w->im_h; + FEH_FILE(w->file->data)->info->height = w->im_h = tmp; + } + winwidget_render_image(w, 1, 0); + return; + } + if (!strcmp(gib_imlib_image_format(w->im), "jpeg") && !path_is_url(FEH_FILE(w->file->data)->filename)) { feh_edit_inplace_lossless(w, op); -- cgit v1.2.3