Remove unused code 85/168885/2 submit/tizen/20180131.074228
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 1 Feb 2018 02:16:50 +0000 (11:16 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 1 Feb 2018 02:20:20 +0000 (11:20 +0900)
Change-Id: I6e0d47fe3cc6b5091afe5a886e64f800132597a0
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
CMakeLists.txt
server/thumb-server-internal.c
src/include/util/media-thumb-util.h
src/util/media-thumb-util.c
test/CMakeLists.txt [deleted file]
test/test-thumb.c [deleted file]
thumbsvr [deleted file]

index 43af6321c962b1bbe2a26cc729d703650b81e0e2..bf9ba1594e3d8c03c096da7a5d54f194f76a1687 100755 (executable)
@@ -76,9 +76,6 @@ INSTALL(TARGETS ${MEDIATHUMB-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
 INSTALL(TARGETS ${MEDIAHASH-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
 
 ADD_SUBDIRECTORY(server)
-ADD_SUBDIRECTORY(test)
 
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/media-thumbnail.h DESTINATION include/${MEDIATHUMB-LIB})
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/include/codec/img-codec-parser.h DESTINATION include/${MEDIATHUMB-LIB})
-#INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/thumbsvr DESTINATION /etc/init.d)
-
index 643f54835cbf26ff17d17d56a5439386b01bcb42..2f85b30b9814eb656f4460899c788e55450b796b 100755 (executable)
@@ -354,11 +354,6 @@ int _media_thumb_process(thumbMsg *req_msg, thumbMsg *res_msg)
 
        thumb_dbg_slog("Thumb path : %s", thumb_path);
 
-       if (g_file_test(thumb_path, G_FILE_TEST_IS_REGULAR)) {
-               thumb_warn("thumb path already exists in file system.. remove the existed file");
-               _media_thumb_remove_file(thumb_path);
-       }
-
        err = _thumbnail_get_data(origin_path, thumb_path);
        if (err != MS_MEDIA_ERR_NONE) {
                thumb_err("_thumbnail_get_data failed - %d", err);
index 5b7b954588039c0072dd0b20a7cd3f95cfddd1e5..64515f21c104704bdb91f5c765739b3ec0f1702d 100755 (executable)
@@ -40,7 +40,5 @@ int _media_thumb_get_file_type(const char *file_full_path);
 
 char* _media_thumb_generate_hash_name(const char *file);
 
-int _media_thumb_remove_file(const char *path);
-
 #endif /*_MEDIA_THUMB_UTIL_H_*/
 
index b9140cbf97217585fa0d48a31cb11d580a5e3d4f..cc0307589ca38e4f88f74a14bbe215f3d22017a1 100755 (executable)
@@ -90,20 +90,6 @@ int _media_thumb_get_file_type(const char *file_full_path)
        return THUMB_NONE_TYPE;
 }
 
-int _media_thumb_remove_file(const char *path)
-{
-       int result = -1;
-
-       result = remove(path);
-       if (result == 0) {
-               thumb_dbg("success to remove file");
-               return TRUE;
-       } else {
-               thumb_stderror("fail to remove file");
-               return FALSE;
-       }
-}
-
 int _media_thumb_get_file_ext(const char *file_path, char *file_ext, int max_len)
 {
        int i = 0;
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
deleted file mode 100644 (file)
index e762c17..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-SET(TEST-THUMB "test-thumb.c")
-
-INCLUDE(FindPkgConfig)
-       pkg_check_modules(pkgs REQUIRED glib-2.0 gthread-2.0 dlog mm-fileinfo aul libmedia-utils libtzplatform-config)
-
-FOREACH(flag ${pkgs_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE")
-
-ADD_EXECUTABLE(test-thumb ${TEST-THUMB})
-TARGET_LINK_LIBRARIES(test-thumb ${pkgs_LDFLAGS} ${MEDIATHUMB-LIB} )
diff --git a/test/test-thumb.c b/test/test-thumb.c
deleted file mode 100755 (executable)
index ac9e638..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * libmedia-thumbnail
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Hyunjun Ko <zzoon.ko@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <pthread.h>
-
-#include "media-thumbnail.h"
-#include "thumb-server-internal.h"
-#include "media-thumb-debug.h"
-#include "media-thumb-ipc.h"
-#include "media-thumb-util.h"
-
-int main(int argc, char *argv[])
-{
-       int mode;
-       int err = -1;
-       unsigned int req_id = 0;
-       const char *origin_path = NULL;
-
-       if ((argc != 3) && (argc != 4)) {
-               printf("Usage: %s [test mode number] [path]\n", argv[0]);
-               return -1;
-       }
-
-       mode = atoi(argv[1]);
-       origin_path = argv[2];
-
-       if (origin_path && (mode == 1)) {
-               printf("Test _thumbnail_get_data\n");
-#if 0
-               char *thumb_path = "thumbnail_path.jpg";
-
-               //long start = thumb_get_debug_time();
-
-               err = _thumbnail_get_data(origin_path, thumb_path);
-               if (err < 0) {
-                       printf("_thumbnail_get_data failed - %d\n", err);
-                       return -1;
-               }
-
-               //long end = thumb_get_debug_time();
-               //printf("Time : %f\n", ((double)(end - start) / (double)CLOCKS_PER_SEC));
-#endif
-       } else if (mode == 2) {
-               printf("Test thumbnail_request_cancel_media\n");
-
-               err = thumbnail_request_cancel_media(req_id);
-               if (err < 0) {
-                       printf("thumbnail_request_cancel_media failed : %d\n", err);
-                       return -1;
-               } else {
-                       printf("thumbnail_request_cancel_media success!\n");
-               }
-       }
-
-       thumb_dbg("Test is Completed");
-
-       return 0;
-}
-
diff --git a/thumbsvr b/thumbsvr
deleted file mode 100644 (file)
index cd5b2d7..0000000
--- a/thumbsvr
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-/etc/init.d/network start
-/usr/bin/media-thumbnail-server &
-