From 24368f2cffc32bbf4487a3c13160f2de1cb6ed6f Mon Sep 17 00:00:00 2001 From: "salt.jeong" Date: Tue, 11 Aug 2020 21:02:04 +0900 Subject: Add exif test code Change-Id: I017b236c9c904c9ab80c45c58824a042fad11077 --- camera/src/controller.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/camera/src/controller.c b/camera/src/controller.c index 21a87ff..6071d86 100644 --- a/camera/src/controller.c +++ b/camera/src/controller.c @@ -147,18 +147,23 @@ static void __thread_write_image_file(void *data, Ecore_Thread *th) height = ad->latest_image_height; buffer = ad->latest_image_buffer; ad->latest_image_buffer = NULL; - image_info = strdup("Specific Data"); pthread_mutex_unlock(&ad->mutex); - ret = controller_image_save_image_file(ad->temp_image_filename, width, height, buffer, + char newFileName[PATH_MAX] = {0, }; + char timeInfo[PATH_MAX] = {0, }; + snprintf(timeInfo, PATH_MAX, "Time: %lld", __get_monotonic_ms()); + snprintf(newFileName, PATH_MAX, "%s_%lld.jpg", ad->temp_image_filename, __get_monotonic_ms()); + image_info = strdup(timeInfo); + + ret = controller_image_save_image_file(newFileName, width, height, buffer, &encoded_buffer, &encoded_size, image_info, strlen(image_info)); - if (ret) { - _E("failed to save image file"); - } else { - ret = rename(ad->temp_image_filename, ad->latest_image_filename); - if (ret != 0 ) - _E("Rename fail"); - } +// if (ret) { +// _E("failed to save image file"); +// } else { +// ret = rename(ad->temp_image_filename, ad->latest_image_filename); +// if (ret != 0 ) +// _E("Rename fail"); +// } pthread_mutex_lock(&ad->mutex); unsigned char *temp = ad->latest_encoded_image_buffer; -- cgit v1.2.3