From: Minje Ahn Date: Mon, 31 May 2021 04:54:10 +0000 (+0900) Subject: Remove path replacement function X-Git-Tag: submit/tizen/20210603.001642^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F18%2F259018%2F3;p=platform%2Fcore%2Fapi%2Fthumbnail-util.git Remove path replacement function 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 --- diff --git a/packaging/capi-media-thumbnail-util.spec b/packaging/capi-media-thumbnail-util.spec index b4dea14..54da0da 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.21 +Version: 0.1.22 Release: 1 Group: Multimedia/API License: Apache-2.0 diff --git a/src/thumbnail_util.c b/src/thumbnail_util.c index 540c9d6..cbce010 100644 --- a/src/thumbnail_util.c +++ b/src/thumbnail_util.c @@ -26,29 +26,6 @@ #include #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;