void __thumbnail_util_convert_itoa(int request_id, char **req_str)
{
- char *buf = NULL;
+ char buf[MAX_SIZE] = {0, };
- buf = malloc(MAX_SIZE * sizeof(char));
-
- if (buf != NULL) {
- snprintf(buf, MAX_SIZE, "%d", request_id);
- *req_str = strndup(buf, strlen(buf));
- SAFE_FREE(buf);
- }
+ snprintf(buf, MAX_SIZE, "%d", request_id);
+ *req_str = strndup(buf, strlen(buf));
}
void __thumbnail_util_extract_completed_cb(int error, int request_id, const char *path, int thumb_width, int thumb_height, unsigned char *thumb_data, int thumb_size, void *user_data)
{
thumbnail_s *_thumb = (thumbnail_s *)thumb;
if (_thumb != NULL && path != NULL) {
- if (_thumb->file_path)
- SAFE_FREE(_thumb->file_path);
+ SAFE_FREE(_thumb->file_path);
_thumb->file_path = strndup(path, strlen(path));
} else {
thumbnail_util_error("INVALID_PARAMETER(0x%08x)", THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER);
#else
thumbnail_h test_info;
thumbnail_util_create(&test_info);
- thumbnail_util_set_path(test_info, "/home/owner/content/Images/test_image1.jpg");
- /*thumbnail_util_set_size(test_info, 511, 288); */
+ thumbnail_util_set_path(test_info, "/opt/usr/home/owner/media/Images/test_image1.jpg");
+ thumbnail_util_set_size(test_info, 511, 288);
ret = thumbnail_util_extract(test_info, thumbnail_completed_cb, test_info, &g_id);
#endif
thumbnail_util_destroy(test_info);