Remove path replacement function 18/259018/3 accepted/tizen/unified/20210603.130714 submit/tizen/20210603.001642
authorMinje Ahn <minje.ahn@samsung.com>
Mon, 31 May 2021 04:54:10 +0000 (13:54 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Mon, 31 May 2021 23:04:36 +0000 (08:04 +0900)
Removed the function that replaces path '/opt/usr/media' with path '/opt/usr/home/owner/media'.
Only some old mobile apps used this hard-coded value.

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

index b4dea14b5f289e2c4a19fa5590caabe9886c29d4..54da0da67800b15e5bdd0ce78526d7251d9f7329 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-media-thumbnail-util
 Summary:    A media thumbnail util library in Tizen Native API
-Version: 0.1.21
+Version:    0.1.22
 Release:    1
 Group:      Multimedia/API
 License:    Apache-2.0
index 540c9d6774bcdabf98f67197f80f70178b802662..cbce010ad8abc98d148ee3f2285bad2927f42f18 100644 (file)
 #include <aul.h>
 
 #define MAX_SIZE 16
-#define MAX_PATH_SIZE 4096
-
-static int __thumbnail_util_replace_path(const char *path, char *replace_path)
-{
-       if (!STRING_VALID(path)) {
-               thumbnail_util_error("Invalid path");
-               return THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER;
-       }
-
-       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(MEDIA_ROOT_PATH_INTERNAL_OLD));
-       } else {
-               snprintf(replace_path, MAX_PATH_SIZE, "%s", path);
-       }
-
-       if (!STRING_VALID(replace_path)) {
-               thumbnail_util_error("replace failed");
-               return THUMBNAIL_UTIL_ERROR_INVALID_OPERATION;
-       }
-
-       return THUMBNAIL_UTIL_ERROR_NONE;
-}
 
 static int __thumbnail_util_error_capi(int internal_error)
 {
@@ -151,19 +128,11 @@ int thumbnail_util_set_path(thumbnail_h thumb, const char *path)
 {
        int ret = THUMBNAIL_UTIL_ERROR_NONE;
        thumbnail_util_warn("DEPRECATION WARNING: thumbnail_util_set_path() is deprecated and will be removed from next release.");
-       char repl_path[MAX_PATH_SIZE + 1] = {0, };
        thumbnail_s *_thumb = (thumbnail_s *)thumb;
 
-       if (_thumb != NULL && path != NULL) {
+       if (_thumb && STRING_VALID(path)) {
                SAFE_FREE(_thumb->file_path);
-               memset(repl_path, 0, sizeof(repl_path));
-               ret = __thumbnail_util_replace_path(path, repl_path);
-               if (ret != THUMBNAIL_UTIL_ERROR_NONE) {
-                       thumbnail_util_error("Convert path failed");
-                       _thumb->file_path = NULL;
-               } else {
-                       _thumb->file_path = strndup(repl_path, strlen(repl_path));
-               }
+               _thumb->file_path = g_strdup(path);
        } else {
                thumbnail_util_error("INVALID_PARAMETER(0x%08x)", THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER);
                ret = THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER;