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;