diff options
| author | Daniel Friesel <derf@finalrewind.org> | 2018-11-04 22:13:28 +0100 | 
|---|---|---|
| committer | Daniel Friesel <derf@finalrewind.org> | 2018-11-04 22:13:28 +0100 | 
| commit | 9d86d3cecc9046922b8a0c49acb60aa480f84a4e (patch) | |
| tree | 129cc1c51c888968aab6752f4639ce4e57b5535c | |
| parent | bc8f6d804edb3f84bdcfbf30b7141ba462695876 (diff) | |
| parent | de185357e745f78e2133da826972502bd1980d1f (diff) | |
Merge branch 'ulteq-no-inplace-edit'
| -rw-r--r-- | src/imlib.c | 28 | ||||
| -rw-r--r-- | src/options.c | 4 | ||||
| -rw-r--r-- | src/options.h | 1 | 
3 files changed, 31 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); diff --git a/src/options.c b/src/options.c index 102c186..19e47f6 100644 --- a/src/options.c +++ b/src/options.c @@ -398,6 +398,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)  		{"bg-fill"       , 0, 0, 218},  		{"bg-max"        , 0, 0, 219},  		{"no-jump-on-resort", 0, 0, 220}, +		{"edit"          , 0, 0, 221},  #ifdef HAVE_LIBEXIF  		{"draw-exif"     , 0, 0, 223},  		{"auto-rotate"   , 0, 0, 242}, @@ -730,6 +731,9 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)  		case 220:  			opt.jump_on_resort = 0;  			break; +		case 221: +			opt.edit = 1; +			break;  #ifdef HAVE_LIBEXIF  		case 223:  			opt.draw_exif = 1; diff --git a/src/options.h b/src/options.h index 72fa03d..1c68fa0 100644 --- a/src/options.h +++ b/src/options.h @@ -80,6 +80,7 @@ struct __fehoptions {  	unsigned char keep_zoom_vp;  	unsigned char insecure_ssl;  	unsigned char filter_by_dimensions; +	unsigned char edit;  	char *output_file;  	char *output_dir; | 
