summaryrefslogtreecommitdiff
path: root/src/imlib.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-11-04 22:13:28 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-11-04 22:13:28 +0100
commit9d86d3cecc9046922b8a0c49acb60aa480f84a4e (patch)
tree129cc1c51c888968aab6752f4639ce4e57b5535c /src/imlib.c
parentbc8f6d804edb3f84bdcfbf30b7141ba462695876 (diff)
parentde185357e745f78e2133da826972502bd1980d1f (diff)
Merge branch 'ulteq-no-inplace-edit'
Diffstat (limited to 'src/imlib.c')
-rw-r--r--src/imlib.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/imlib.c b/src/imlib.c
index 18547a9..4270c4a 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -1204,6 +1204,26 @@ void feh_edit_inplace(winwidget w, int op)
if (!w->file || !w->file->data || !FEH_FILE(w->file->data)->filename)
return;
+ if (!opt.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;
+ w->im_w = w->im_h;
+ w->im_h = tmp;
+ if (FEH_FILE(w->file->data)->info) {
+ FEH_FILE(w->file->data)->info->width = w->im_w;
+ FEH_FILE(w->file->data)->info->height = w->im_h;
+ }
+ }
+ 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);
@@ -1241,8 +1261,12 @@ void feh_edit_inplace(winwidget w, int op)
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;
+ w->im_w = w->im_h;
+ w->im_h = tmp;
+ if (FEH_FILE(w->file->data)->info) {
+ FEH_FILE(w->file->data)->info->width = w->im_w;
+ FEH_FILE(w->file->data)->info->height = w->im_h;
+ }
}
im_weprintf(w, "unable to edit in place. Changes have not been saved.");
winwidget_render_image(w, 1, 0);