summaryrefslogtreecommitdiff
path: root/src/ipc/media-thumb-ipc.c
diff options
context:
space:
mode:
authorJiyong Min <jiyong.min@samsung.com>2017-04-06 10:45:54 (GMT)
committerJiyong Min <jiyong.min@samsung.com>2017-04-07 10:45:37 (GMT)
commite10f2207aeea99bcde0258359d4d336d4ae9d253 (patch)
treef6c8682ab5615500ad79896a7ade961ccf5df34d /src/ipc/media-thumb-ipc.c
parentaee150adb2f1ea46f8ab3e1ee32896338bc811eb (diff)
downloadlibmedia-thumbnail-e10f2207aeea99bcde0258359d4d336d4ae9d253.zip
libmedia-thumbnail-e10f2207aeea99bcde0258359d4d336d4ae9d253.tar.gz
libmedia-thumbnail-e10f2207aeea99bcde0258359d4d336d4ae9d253.tar.bz2
Check Error type and remove Unused coderefs/changes/71/123671/8
1. Check Proper Error Type when create thumbnail and return it to App. 2. Remove unused THUMB_REQUEST_SAVE_FILE related code Change-Id: Idf40c8f3a515319bcccce81dcd49d7cda8d56165 Signed-off-by: Jiyong Min <jiyong.min@samsung.com>
Diffstat (limited to 'src/ipc/media-thumb-ipc.c')
-rwxr-xr-xsrc/ipc/media-thumb-ipc.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/ipc/media-thumb-ipc.c b/src/ipc/media-thumb-ipc.c
index 6aee3a3..693a3fa 100755
--- a/src/ipc/media-thumb-ipc.c
+++ b/src/ipc/media-thumb-ipc.c
@@ -585,11 +585,6 @@ _media_thumb_request(int msg_type, const char *origin_path, char *thumb_path, in
strncpy(req_msg.org_path, origin_path, sizeof(req_msg.org_path));
req_msg.org_path[strlen(req_msg.org_path)] = '\0';
- if (msg_type == THUMB_REQUEST_SAVE_FILE) {
- strncpy(req_msg.dst_path, thumb_path, sizeof(req_msg.dst_path));
- req_msg.dst_path[strlen(req_msg.dst_path)] = '\0';
- }
-
req_msg.origin_path_size = strlen(req_msg.org_path) + 1;
req_msg.dest_path_size = strlen(req_msg.dst_path) + 1;
req_msg.thumb_size = 0;
@@ -635,15 +630,13 @@ _media_thumb_request(int msg_type, const char *origin_path, char *thumb_path, in
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
- if (recv_msg.status == THUMB_FAIL) {
+ if (recv_msg.status != MS_MEDIA_ERR_NONE) {
thumb_err("Failed to make thumbnail");
SAFE_FREE(recv_msg.thumb_data);
- return MS_MEDIA_ERR_INVALID_PARAMETER;
+ return recv_msg.status;
}
- if (msg_type != THUMB_REQUEST_SAVE_FILE) {
- strncpy(thumb_path, recv_msg.dst_path, max_length);
- }
+ strncpy(thumb_path, recv_msg.dst_path, max_length);
thumb_info->origin_width = recv_msg.origin_width;
thumb_info->origin_height = recv_msg.origin_height;
@@ -678,11 +671,9 @@ gboolean _media_thumb_write_socket(GIOChannel *src, GIOCondition condition, gpoi
return FALSE;
}
- //thumb_dbg("Completed..%s", recv_msg.org_path);
-
- if (recv_msg.status == THUMB_FAIL) {
- thumb_err("Failed to make thumbnail");
- err = MS_MEDIA_ERR_INTERNAL;
+ if (recv_msg.status != MS_MEDIA_ERR_NONE) {
+ err = recv_msg.status;
+ thumb_err("Failed to make thumbnail (%d)", err);
}
if (__media_thumb_check_cancel()) {
@@ -729,9 +720,9 @@ gboolean _media_thumb_raw_data_write_socket(GIOChannel *src, GIOCondition condit
g_io_channel_shutdown(src, TRUE, NULL);
g_io_channel_unref(src);
- if (recv_msg.status == THUMB_FAIL) {
- thumb_err("Failed to make thumbnail");
- err = MS_MEDIA_ERR_INTERNAL;
+ if (recv_msg.status != MS_MEDIA_ERR_NONE) {
+ err = recv_msg.status;
+ thumb_err("Failed to make thumbnail (%d)", err);
}
if (__media_thumb_check_cancel_for_raw()) {