Update path replacement function 00/186300/1 accepted/tizen/4.0/unified/20180829.004558 accepted/tizen/4.0/unified/20190712.090401 submit/tizen_4.0/20180819.230242 submit/tizen_4.0/20190712.015449
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 9 Aug 2018 00:48:30 +0000 (09:48 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 9 Aug 2018 00:48:30 +0000 (09:48 +0900)
Use hardcording instead of storage API (because of storage API changes)

Change-Id: Ib159da864c5a794a914d0ea1476fc9ef0f97e913
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
packaging/capi-media-thumbnail-util.spec
src/thumbnail_util.c

index 617caac28cc3ee961c216883753cac5ccbca5ada..3a7eaab1b609adba45294bdfbc86487fc1ae10a0 100755 (executable)
@@ -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
index 506e7fd2664f21528281797a77db0dcc6208bfa5..2853e49efcb97770a052fb5f560040b56f0736b7 100755 (executable)
 
 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;