From: Minje Ahn Date: Thu, 2 Aug 2018 04:58:46 +0000 (+0900) Subject: Update path replacement function X-Git-Tag: submit/tizen/20180809.003539^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=098501e67bde03b0ef0473d0d801c43ed8056303;p=platform%2Fcore%2Fapi%2Fthumbnail-util.git Update path replacement function Use hardcording instead of storae API (because of storage API changes) Change-Id: Iaa2e9ac383f5d773e5370993cb3eb31f7a86ef6a Signed-off-by: Minje Ahn --- diff --git a/packaging/capi-media-thumbnail-util.spec b/packaging/capi-media-thumbnail-util.spec index 7bfbd40..7b1fd15 100755 --- a/packaging/capi-media-thumbnail-util.spec +++ b/packaging/capi-media-thumbnail-util.spec @@ -1,6 +1,6 @@ Name: capi-media-thumbnail-util Summary: A media thumbnail util library in Tizen Native API -Version: 0.1.16 +Version: 0.1.17 Release: 1 Group: Multimedia/API License: Apache-2.0 diff --git a/src/thumbnail_util.c b/src/thumbnail_util.c index 16e3ef2..eb83aa9 100755 --- a/src/thumbnail_util.c +++ b/src/thumbnail_util.c @@ -32,29 +32,18 @@ int __thumbnail_util_replace_path(const char *path, char *replace_path) { - int ret = THUMBNAIL_UTIL_ERROR_NONE; - char *old_path = NULL; - if (!STRING_VALID(path)) { thumbnail_util_error("Invalid path"); return THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER; } - ret = storage_get_root_directory(STORAGE_TYPE_INTERNAL, &old_path); - if (ret != STORAGE_ERROR_NONE) { - thumbnail_util_error("storage_get_root_directory failed"); - return THUMBNAIL_UTIL_ERROR_INVALID_OPERATION; - } - - if (strncmp(path, old_path, strlen(old_path)) == 0) { + if (strncmp(path, MEDIA_ROOT_PATH_INTERNAL_OLD, strlen(MEDIA_ROOT_PATH_INTERNAL_OLD)) == 0) { thumbnail_util_sec_debug("Old path[%s]", path); - snprintf(replace_path, MAX_PATH_SIZE, "%s%s", tzplatform_getenv(TZ_USER_CONTENT), path + strlen(old_path)); + snprintf(replace_path, MAX_PATH_SIZE, "%s%s", tzplatform_getenv(TZ_USER_CONTENT), path + strlen(MEDIA_ROOT_PATH_INTERNAL_OLD)); } else { snprintf(replace_path, MAX_PATH_SIZE, "%s", path); } - SAFE_FREE(old_path); - if (!STRING_VALID(replace_path)) { thumbnail_util_error("replace failed"); return THUMBNAIL_UTIL_ERROR_INVALID_OPERATION;