Update script port
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 7 Jan 2015 06:44:07 +0000 (15:44 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 7 Jan 2015 06:44:07 +0000 (15:44 +0900)
[model] Redwood,Kiran,B3(Wearable)
[binary_type] AP
[customer] Docomo/Orange/ATT/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: Idab75104c318b420ff8a878b7095ac835081a4ef

src/script_port.c

index 790b75e..b348011 100644 (file)
@@ -711,12 +711,12 @@ static Evas_Object *crop_image(Evas_Object *img, const char *path, int part_w, i
        Evas_Coord rw, rh;
        const void *data;
        Evas_Load_Error err;
+       Evas_Object *_img;
 
        ee = ecore_evas_buffer_new(part_w, part_h);
        if (!ee) {
                ErrPrint("Failed to create a EE\n");
-               evas_object_del(img);
-               return NULL;
+               return img;
        }
 
        ecore_evas_alpha_set(ee, EINA_TRUE);
@@ -725,16 +725,14 @@ static Evas_Object *crop_image(Evas_Object *img, const char *path, int part_w, i
        if (!e) {
                ErrPrint("Unable to get Evas\n");
                ecore_evas_free(ee);
-               evas_object_del(img);
-               return NULL;
+               return img;
        }
 
        src_img = evas_object_image_filled_add(e);
        if (!src_img) {
                ErrPrint("Unable to add an image\n");
                ecore_evas_free(ee);
-               evas_object_del(img);
-               return NULL;
+               return img;
        }
 
        evas_object_image_alpha_set(src_img, EINA_TRUE);
@@ -747,8 +745,7 @@ static Evas_Object *crop_image(Evas_Object *img, const char *path, int part_w, i
                ErrPrint("Load error: %s\n", evas_load_error_str(err));
                evas_object_del(src_img);
                ecore_evas_free(ee);
-               evas_object_del(img);
-               return NULL;
+               return img;
        }
        evas_object_image_size_get(src_img, &rw, &rh);
        evas_object_image_fill_set(src_img, 0, 0, rw, rh);
@@ -761,33 +758,32 @@ static Evas_Object *crop_image(Evas_Object *img, const char *path, int part_w, i
                ErrPrint("Unable to get pixels\n");
                evas_object_del(src_img);
                ecore_evas_free(ee);
-               evas_object_del(img);
-               return NULL;
+               return img;
        }
 
        e = evas_object_evas_get(img);
-       evas_object_del(img);
-       img = evas_object_image_filled_add(e);
-       if (!img) {
+       _img = evas_object_image_filled_add(e);
+       if (!_img) {
                evas_object_del(src_img);
                ecore_evas_free(ee);
-               return NULL;
+               return img;
        }
 
-       evas_object_image_colorspace_set(img, EVAS_COLORSPACE_ARGB8888);
-       evas_object_image_smooth_scale_set(img, EINA_TRUE);
-       evas_object_image_alpha_set(img, EINA_TRUE);
-       evas_object_image_data_set(img, NULL);
-       evas_object_image_size_set(img, part_w, part_h);
-       evas_object_resize(img, part_w, part_h);
-       evas_object_image_data_copy_set(img, (void *)data);
-       evas_object_image_fill_set(img, 0, 0, part_w, part_h);
-       evas_object_image_data_update_add(img, 0, 0, part_w, part_h);
+       evas_object_image_colorspace_set(_img, EVAS_COLORSPACE_ARGB8888);
+       evas_object_image_smooth_scale_set(_img, EINA_TRUE);
+       evas_object_image_alpha_set(_img, EINA_TRUE);
+       evas_object_image_data_set(_img, NULL);
+       evas_object_image_size_set(_img, part_w, part_h);
+       evas_object_resize(_img, part_w, part_h);
+       evas_object_image_data_copy_set(_img, (void *)data);
+       evas_object_image_fill_set(_img, 0, 0, part_w, part_h);
+       evas_object_image_data_update_add(_img, 0, 0, part_w, part_h);
 
        evas_object_del(src_img);
        ecore_evas_free(ee);
 
-       return img;
+       evas_object_del(img);
+       return _img;
 }
 
 PUBLIC int script_update_image(void *_h, const char *id, const char *part, const char *path, const char *option)