summaryrefslogtreecommitdiff
path: root/src/ipc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipc')
-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()) {