-void thumbnail_completed_cb(thumbnail_util_error_e error,
- const char *request_id,
- int thumb_width,
- int thumb_height,
- unsigned char *thumb_data,
- int thumb_size,
- void *user_data)
-{
- MSG_BEGIN();
-
- g_mx.lock();
-
- if (!user_data) {
- MSG_WARN("dstPath is NULL");
- g_cv.signal();
- g_mx.unlock();
- return;
- }
-
- MSG_DEBUG("=================[RESULT]");
- MSG_DEBUG("error_code [%d]", error);
- MSG_DEBUG("request id [%s]", request_id);
- MSG_DEBUG("width [%d], height [%d]", thumb_width, thumb_height);
- MSG_DEBUG("size [%d]", thumb_size);
-
- int ret = 0;
- image_util_encode_h eh = NULL;
-
- do {
- unsigned long long ll_size_encode = 0;
-
- ret = image_util_encode_create(IMAGE_UTIL_JPEG, &eh);
- if (IMAGE_UTIL_ERROR_NONE != ret)
- break;
- ret = image_util_encode_set_input_buffer(eh, thumb_data);
- if (IMAGE_UTIL_ERROR_NONE != ret)
- break;
- ret = image_util_encode_set_resolution(eh, thumb_width, thumb_height);
- if (IMAGE_UTIL_ERROR_NONE != ret)
- break;
- ret = image_util_encode_set_colorspace(eh, IMAGE_UTIL_COLORSPACE_BGRA8888);
- if (IMAGE_UTIL_ERROR_NONE != ret)
- break;
- ret = image_util_encode_set_quality(eh, 100);
- if (IMAGE_UTIL_ERROR_NONE != ret)
- break;
- ret = image_util_encode_set_output_path(eh, (char *)user_data);
- if (IMAGE_UTIL_ERROR_NONE != ret)
- break;
- ret = image_util_encode_run(eh, &ll_size_encode);
- } while (0);
-
- if (eh)
- image_util_encode_destroy(eh);
-
- if (ret != IMAGE_UTIL_ERROR_NONE)
- MSG_WARN("image_util_encode_jpeg() is failed");
-
- g_cv.signal();
- g_mx.unlock();
-
- MSG_END();
-}
-