From 9394902746613db6252be3f78b6fe7ba14f18172 Mon Sep 17 00:00:00 2001 From: Stephen okra Houston Date: Mon, 25 Jul 2016 17:10:01 -0500 Subject: [PATCH] Ephoto: Add ability to scale images. --- src/bin/Makefile.am | 7 ++++--- src/bin/ephoto.h | 2 ++ src/bin/ephoto_single_browser.c | 16 ++++++++++++++++ src/bin/ephoto_thumb.c | 1 + 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index e500760..a5a1dd6 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -32,10 +32,11 @@ ephoto_SOURCES = \ ephoto_ipc.c \ ephoto_main.c \ ephoto_red_eye.c \ - ephoto_thumb.c \ - ephoto_thumb_browser.c \ + ephoto_scale.c \ ephoto_single_browser.c \ - ephoto_slideshow.c + ephoto_slideshow.c \ + ephoto_thumb.c \ + ephoto_thumb_browser.c internal_bindir = $(datadir)/$(PACKAGE) internal_bin_PROGRAMS = ephoto_thumbnail diff --git a/src/bin/ephoto.h b/src/bin/ephoto.h index b764722..3655094 100644 --- a/src/bin/ephoto.h +++ b/src/bin/ephoto.h @@ -142,6 +142,8 @@ void ephoto_color_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Object *image); void ephoto_red_eye_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Object *image); +void ephoto_scale_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, + Evas_Object *image); void ephoto_filter_blur(Evas_Object *main, Evas_Object *image); void ephoto_filter_sharpen(Evas_Object *main, Evas_Object *image); void ephoto_filter_dither(Evas_Object *main, Evas_Object *image); diff --git a/src/bin/ephoto_single_browser.c b/src/bin/ephoto_single_browser.c index 3b01917..dd9248c 100644 --- a/src/bin/ephoto_single_browser.c +++ b/src/bin/ephoto_single_browser.c @@ -1026,6 +1026,21 @@ _crop_image(void *data, Evas_Object *obj EINA_UNUSED, } } +static void +_scale_image(void *data, Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Ephoto_Single_Browser *sb = data; + + if (sb->viewer) + { + sb->editing = EINA_TRUE; + Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer"); + + ephoto_scale_add(sb->ephoto, sb->main, sb->mhbox, v->image); + } +} + static void _go_bcg(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { @@ -1475,6 +1490,7 @@ _add_edit_menu_items(Ephoto_Single_Browser *sb, Evas_Object *menu) elm_menu_item_add(menu, menu_it, "document-properties", _("Transform"), NULL, NULL); elm_menu_item_add(menu, menu_itt, "edit-cut", _("Crop"), _crop_image, sb); + elm_menu_item_add(menu, menu_itt, "zoom-in", _("Scale"), _scale_image, sb); elm_menu_item_separator_add(menu, menu_itt); elm_menu_item_add(menu, menu_itt, "object-rotate-left", _("Rotate Left"), _go_rotate_counterclock, sb); diff --git a/src/bin/ephoto_thumb.c b/src/bin/ephoto_thumb.c index 07d2873..27c81aa 100644 --- a/src/bin/ephoto_thumb.c +++ b/src/bin/ephoto_thumb.c @@ -258,6 +258,7 @@ e_thumb_client_data(Ecore_Ipc_Event_Client_Data *e) eth->busy = 0; _pending--; eth->done = 1; + e_thumb_icon_end(obj); if (_pending == 0) _e_thumb_thumbnailers_kill(); if (ecore_file_exists(icon)) {