summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2017-07-11 05:26:16 (GMT)
committerMinje Ahn <minje.ahn@samsung.com>2017-07-11 05:26:16 (GMT)
commitc5869473bdf194dd44dc56d269399487106ff759 (patch)
tree871bcf83ff06ebfa7b8aca791d9763c6be6769c6 /src
parent86c10c47be22e9caa4c8c2106437136a123ec3ac (diff)
downloadlibmedia-thumbnail-c5869473bdf194dd44dc56d269399487106ff759.zip
libmedia-thumbnail-c5869473bdf194dd44dc56d269399487106ff759.tar.gz
libmedia-thumbnail-c5869473bdf194dd44dc56d269399487106ff759.tar.bz2
Remove original width, height parameters from response msgrefs/changes/94/138094/1
Change-Id: I7b11e8744939e67130826e43708e5474e39ed975 Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/include/ipc/media-thumb-ipc.h1
-rwxr-xr-xsrc/include/util/media-thumb-db.h4
-rwxr-xr-xsrc/ipc/media-thumb-ipc.c10
-rwxr-xr-xsrc/media-thumbnail.c13
-rwxr-xr-xsrc/util/media-thumb-db.c4
5 files changed, 7 insertions, 25 deletions
diff --git a/src/include/ipc/media-thumb-ipc.h b/src/include/ipc/media-thumb-ipc.h
index a7cce71..cc021b6 100755
--- a/src/include/ipc/media-thumb-ipc.h
+++ b/src/include/ipc/media-thumb-ipc.h
@@ -50,7 +50,6 @@ int _media_thumb_request(int msg_type,
const char *origin_path,
char *thumb_path,
int max_length,
- media_thumb_info *thumb_info,
uid_t uid);
int _media_thumb_request_async(int msg_type,
diff --git a/src/include/util/media-thumb-db.h b/src/include/util/media-thumb-db.h
index 6156d10..c1ccec1 100755
--- a/src/include/util/media-thumb-db.h
+++ b/src/include/util/media-thumb-db.h
@@ -29,10 +29,10 @@
#define SQLITE3_FINALIZE(x) {if (x != NULL) sqlite3_finalize(x); }
#define SQLITE3_SAFE_FREE(x) {if (x != NULL) {sqlite3_free(x); x = NULL; } }
-#define SELECT_THUMB_BY_PATH "SELECT thumbnail_path, width, height FROM media WHERE path='%q' AND thumbnail_path IS NOT NULL;"
+#define SELECT_THUMB_BY_PATH "SELECT thumbnail_path FROM media WHERE path='%q' AND thumbnail_path IS NOT NULL;"
#define UPDATE_THUMB_BY_PATH "UPDATE media SET thumbnail_path = '%q' WHERE path='%q';"
-int _media_thumb_get_thumb_from_db_with_size(const char *origin_path, char *thumb_path, int max_length, int *width, int *height, uid_t uid);
+int _media_thumb_get_thumb_from_db(const char *origin_path, char *thumb_path, int max_length, uid_t uid);
int _media_thumb_update_db(const char *origin_path, char *thumb_path, uid_t uid);
#endif /*_MEDIA_THUMB_DB_H_*/
diff --git a/src/ipc/media-thumb-ipc.c b/src/ipc/media-thumb-ipc.c
index e86658c..9064a7b 100755
--- a/src/ipc/media-thumb-ipc.c
+++ b/src/ipc/media-thumb-ipc.c
@@ -541,7 +541,7 @@ _media_thumb_set_buffer(thumbMsg *req_msg, unsigned char **buf, int *buf_size)
}
int
-_media_thumb_request(int msg_type, const char *origin_path, char *thumb_path, int max_length, media_thumb_info *thumb_info, uid_t uid)
+_media_thumb_request(int msg_type, const char *origin_path, char *thumb_path, int max_length, uid_t uid)
{
int sock = -1;
struct sockaddr_un serv_addr;
@@ -620,26 +620,20 @@ _media_thumb_request(int msg_type, const char *origin_path, char *thumb_path, in
thumb_dbg_slog("recv %s(%d) from thumb daemon is successful", recv_msg.org_path, recv_str_len);
close(sock);
+ SAFE_FREE(recv_msg.thumb_data);
if (recv_str_len > max_length) {
thumb_err("user buffer is too small. Output's length is %d", recv_str_len);
- SAFE_FREE(recv_msg.thumb_data);
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
if (recv_msg.status != MS_MEDIA_ERR_NONE) {
thumb_err("Failed to make thumbnail");
- SAFE_FREE(recv_msg.thumb_data);
return recv_msg.status;
}
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;
-
- SAFE_FREE(recv_msg.thumb_data);
-
return MS_MEDIA_ERR_NONE;
}
diff --git a/src/media-thumbnail.c b/src/media-thumbnail.c
index f3ba2bc..b7fa359 100755
--- a/src/media-thumbnail.c
+++ b/src/media-thumbnail.c
@@ -27,21 +27,15 @@
#include <glib.h>
-int thumbnail_request_from_db_with_size(const char *origin_path, char *thumb_path, int max_length, int *origin_width, int *origin_height, uid_t uid)
+int thumbnail_request_from_db(const char *origin_path, char *thumb_path, int max_length, uid_t uid)
{
int err = MS_MEDIA_ERR_NONE;
- media_thumb_info thumb_info;
if (origin_path == NULL || thumb_path == NULL) {
thumb_err("Invalid parameter");
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
- if (origin_width == NULL || origin_height == NULL) {
- thumb_err("Invalid parameter ( width or height )");
- return MS_MEDIA_ERR_INVALID_PARAMETER;
- }
-
if (!g_file_test(origin_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
thumb_err("Original path(%s) doesn't exist.", origin_path);
return MS_MEDIA_ERR_INVALID_PARAMETER;
@@ -63,15 +57,12 @@ int thumbnail_request_from_db_with_size(const char *origin_path, char *thumb_pat
thumb_dbg_slog("Path : %s", origin_path);
/* Request for thumb file to the daemon "Thumbnail generator" */
- err = _media_thumb_request(THUMB_REQUEST_DB_INSERT, origin_path, thumb_path, max_length, &thumb_info, uid);
+ err = _media_thumb_request(THUMB_REQUEST_DB_INSERT, origin_path, thumb_path, max_length, uid);
if (err != MS_MEDIA_ERR_NONE) {
thumb_err("_media_thumb_request failed : %d", err);
return err;
}
- *origin_width = thumb_info.origin_width;
- *origin_height = thumb_info.origin_height;
-
return MS_MEDIA_ERR_NONE;
}
diff --git a/src/util/media-thumb-db.c b/src/util/media-thumb-db.c
index 8527da0..d955a46 100755
--- a/src/util/media-thumb-db.c
+++ b/src/util/media-thumb-db.c
@@ -27,7 +27,7 @@
#include <string.h>
#include <unistd.h>
-int _media_thumb_get_thumb_from_db_with_size(const char *origin_path, char *thumb_path, int max_length, int *width, int *height, uid_t uid)
+int _media_thumb_get_thumb_from_db(const char *origin_path, char *thumb_path, int max_length, uid_t uid)
{
int err = MS_MEDIA_ERR_NONE;
char *query_string = NULL;
@@ -59,8 +59,6 @@ int _media_thumb_get_thumb_from_db_with_size(const char *origin_path, char *thum
if (sqlite3_step(stmt) == SQLITE_ROW) {
strncpy(thumb_path, (const char *)sqlite3_column_text(stmt, 0), max_length);
- *width = sqlite3_column_int(stmt, 1);
- *height = sqlite3_column_int(stmt, 2);
} else {
thumb_err("end of row [%s]", sqlite3_errmsg(db_handle));
SQLITE3_FINALIZE(stmt);