From b5bedb7541d78fd966e025266a6fadc3e3e0fd2d Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Mon, 19 Jun 2017 12:55:54 +0900 Subject: Remove image-util dependency Remove image-util dependency when create agif thumbnail Change-Id: Ie6a96e8b5132e4b6be0e86b7cf23e4c29aba65c1 Signed-off-by: Minje Ahn --- test/test-thumb.c | 55 +++++++++++++++++-------------------------------------- 1 file changed, 17 insertions(+), 38 deletions(-) (limited to 'test') diff --git a/test/test-thumb.c b/test/test-thumb.c index 6ab7657..4c4a3ff 100755 --- a/test/test-thumb.c +++ b/test/test-thumb.c @@ -25,8 +25,6 @@ #include #include #include -#include -#include #include "media-thumbnail.h" #include "thumb-server-internal.h" @@ -57,40 +55,23 @@ int save_to_file_with_evas(unsigned char *data, int w, int h, int is_bgra) evas_object_image_fill_set(img, 0, 0, w, h); if (!is_bgra) { - unsigned char *m = NULL; - m = evas_object_image_data_get(img, 1); -#if 1 /* Use self-logic to convert from RGB888 to RGBA */ - int i = 0, j; - for (j = 0; j < w * 3 * h; - j += 3) { - m[i++] = (data[j + 2]); - m[i++] = (data[j + 1]); - m[i++] = (data[j]); - m[i++] = 0x0; - } - -#else /* Use mmf api to convert from RGB888 to RGBA */ - int mm_ret = 0; - if ((mm_ret = - mm_util_convert_colorspace(data, - w, - h, - MM_UTIL_IMG_FMT_RGB888, - m, - MM_UTIL_IMG_FMT_BGRA8888)) - < 0) { - printf - ("Failed to change from rgb888 to argb8888 %d\n", - mm_ret); - return -1; - } -#endif /* End of use mmf api to convert from RGB888 to RGBA */ + unsigned char *m = NULL; + m = evas_object_image_data_get(img, 1); + /* Use self-logic to convert from RGB888 to RGBA */ + int i = 0, j; + for (j = 0; j < w * 3 * h; + j += 3) { + m[i++] = (data[j + 2]); + m[i++] = (data[j + 1]); + m[i++] = (data[j]); + m[i++] = 0x0; + } - evas_object_image_data_set(img, m); - evas_object_image_data_update_add(img, 0, 0, w, h); + evas_object_image_data_set(img, m); + evas_object_image_data_update_add(img, 0, 0, w, h); } else { - evas_object_image_data_set(img, data); - evas_object_image_data_update_add(img, 0, 0, w, h); + evas_object_image_data_set(img, data); + evas_object_image_data_update_add(img, 0, 0, w, h); } if (evas_object_image_save @@ -163,9 +144,7 @@ int main(int argc, char *argv[]) //long end = thumb_get_debug_time(); //printf("Time : %f\n", ((double)(end - start) / (double)CLOCKS_PER_SEC)); #endif - } else if (origin_path && mode == 4) { - printf("Success!!\n"); - } else if (mode == 6) { + } else if (mode == 2) { printf("Test thumbnail_request_cancel_media\n"); err = thumbnail_request_cancel_media(req_id, origin_path); @@ -175,7 +154,7 @@ int main(int argc, char *argv[]) } else { printf("thumbnail_request_cancel_media success!\n"); } - } else if (mode == 7) { + } else if (mode == 3) { printf("Test thumbnail_request_cancel_all\n"); err = thumbnail_request_cancel_all(true); -- cgit v1.2.3