From: Minje Ahn Date: Thu, 9 Aug 2018 00:48:30 +0000 (+0900) Subject: Update path replacement function X-Git-Tag: submit/tizen_4.0/20180819.230242^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab3d9b6c44b9918ef63a55fa17bf1ea2f7fa08d3;p=platform%2Fcore%2Fapi%2Fthumbnail-util.git Update path replacement function Use hardcording instead of storage API (because of storage API changes) Change-Id: Ib159da864c5a794a914d0ea1476fc9ef0f97e913 Signed-off-by: Minje Ahn --- diff --git a/packaging/capi-media-thumbnail-util.spec b/packaging/capi-media-thumbnail-util.spec index 617caac..3a7eaab 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.11 +Version: 0.1.12 Release: 1 Group: Multimedia/API License: Apache-2.0 diff --git a/src/thumbnail_util.c b/src/thumbnail_util.c index 506e7fd..2853e49 100755 --- a/src/thumbnail_util.c +++ b/src/thumbnail_util.c @@ -25,29 +25,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_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;