diff options
author | Minje Ahn <minje.ahn@samsung.com> | 2017-06-19 12:55:54 +0900 |
---|---|---|
committer | Minje Ahn <minje.ahn@samsung.com> | 2017-06-19 13:31:25 +0900 |
commit | b5bedb7541d78fd966e025266a6fadc3e3e0fd2d (patch) | |
tree | ba338a9726ee9fe50b55416979930da1aafa0ba3 /test | |
parent | 75c4bd5f2433f484a974b913d9e58cf5f5cdb187 (diff) | |
download | libmedia-thumbnail-b5bedb7541d78fd966e025266a6fadc3e3e0fd2d.tar.gz libmedia-thumbnail-b5bedb7541d78fd966e025266a6fadc3e3e0fd2d.tar.bz2 libmedia-thumbnail-b5bedb7541d78fd966e025266a6fadc3e3e0fd2d.zip |
Remove image-util dependency
Remove image-util dependency when create agif thumbnail
Change-Id: Ie6a96e8b5132e4b6be0e86b7cf23e4c29aba65c1
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-thumb.c | 55 |
1 files changed, 17 insertions, 38 deletions
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 <pthread.h> #include <Evas.h> #include <Ecore_Evas.h> -#include <mm_util_imgp.h> -#include <mm_util_jpeg.h> #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); |