diff options
Diffstat (limited to 'test/test-thumb.c')
-rwxr-xr-x | test/test-thumb.c | 85 |
1 files changed, 1 insertions, 84 deletions
diff --git a/test/test-thumb.c b/test/test-thumb.c index 47e2903..ac9e638 100755 --- a/test/test-thumb.c +++ b/test/test-thumb.c @@ -23,8 +23,6 @@ #include <stdlib.h> #include <string.h> #include <pthread.h> -#include <Evas.h> -#include <Ecore_Evas.h> #include "media-thumbnail.h" #include "thumb-server-internal.h" @@ -32,61 +30,6 @@ #include "media-thumb-ipc.h" #include "media-thumb-util.h" -int save_to_file_with_evas(unsigned char *data, int w, int h, int is_bgra) -{ - ecore_evas_init(); - - Ecore_Evas *ee = - ecore_evas_buffer_new(w, h); - Evas *evas = ecore_evas_get(ee); - - Evas_Object *img = NULL; - img = evas_object_image_add(evas); - - if (img == NULL) { - printf("image object is NULL\n"); - ecore_evas_free(ee); - ecore_evas_shutdown(); - return -1; - } - - evas_object_image_colorspace_set(img, EVAS_COLORSPACE_ARGB8888); - evas_object_image_size_set(img, w, h); - 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); - /* 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); - } else { - evas_object_image_data_set(img, data); - evas_object_image_data_update_add(img, 0, 0, w, h); - } - - if (evas_object_image_save - (img, "/mnt/nfs/test.jpg", NULL, - "quality=50 compress=2")) { - printf("evas_object_image_save success\n"); - } else { - printf("evas_object_image_save failed\n"); - } - - ecore_evas_shutdown(); - - return 0; -} - int main(int argc, char *argv[]) { int mode; @@ -105,42 +48,16 @@ int main(int argc, char *argv[]) if (origin_path && (mode == 1)) { printf("Test _thumbnail_get_data\n"); #if 0 - unsigned char *data = NULL; - int thumb_size = 0; - int thumb_w = 0; - int thumb_h = 0; - int origin_w = 0; - int origin_h = 0; - int alpha = FALSE; - bool is_saved = FALSE; char *thumb_path = "thumbnail_path.jpg"; - int is_bgra = 1; - //int is_bgra = 0; - //long start = thumb_get_debug_time(); - err = _thumbnail_get_data(origin_path, thumb_path, &data, &thumb_size, &thumb_w, &thumb_h, &origin_w, &origin_h, &alpha, &is_saved); + err = _thumbnail_get_data(origin_path, thumb_path); if (err < 0) { printf("_thumbnail_get_data failed - %d\n", err); return -1; } - printf("Size : %d, W:%d, H:%d\n", thumb_size, thumb_w, thumb_h); - printf("Origin W:%d, Origin H:%d\n", origin_w, origin_h); - - if (is_saved == FALSE) { - err = save_to_file_with_evas(data, thumb_w, thumb_h, is_bgra); - if (err < 0) { - printf("save_to_file_with_evas failed - %d\n", err); - return -1; - } else { - printf("file save success\n"); - } - } - - SAFE_FREE(data); - //long end = thumb_get_debug_time(); //printf("Time : %f\n", ((double)(end - start) / (double)CLOCKS_PER_SEC)); #endif |