summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2017-07-11 01:53:47 (GMT)
committerMinje Ahn <minje.ahn@samsung.com>2017-07-11 01:53:47 (GMT)
commit86c10c47be22e9caa4c8c2106437136a123ec3ac (patch)
tree9e3d56013c0e2bd16dda905b58e1f2bb700fb7a8
parenta0279549d93bc61a5edea68e819a53f2668b0915 (diff)
downloadlibmedia-thumbnail-86c10c47be22e9caa4c8c2106437136a123ec3ac.zip
libmedia-thumbnail-86c10c47be22e9caa4c8c2106437136a123ec3ac.tar.gz
libmedia-thumbnail-86c10c47be22e9caa4c8c2106437136a123ec3ac.tar.bz2
Remove width, height from UPDATE queryrefs/changes/38/138038/1
width, height value is updated by extract metadata Change-Id: Ife112a4e80ddb6821764904d9165c46ae3fe7093 Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
-rwxr-xr-xserver/thumb-server-internal.c2
-rwxr-xr-xsrc/include/util/media-thumb-db.h3
-rwxr-xr-xsrc/util/media-thumb-db.c8
3 files changed, 4 insertions, 9 deletions
diff --git a/server/thumb-server-internal.c b/server/thumb-server-internal.c
index 99c2e20..7dfd897 100755
--- a/server/thumb-server-internal.c
+++ b/server/thumb-server-internal.c
@@ -505,7 +505,7 @@ int _media_thumb_process(thumbMsg *req_msg, thumbMsg *res_msg)
SAFE_FREE(data);
DB_UPDATE:
- err = _media_thumb_update_db(origin_path, thumb_path, res_msg->origin_width, res_msg->origin_height, req_msg->uid);
+ err = _media_thumb_update_db(origin_path, thumb_path, req_msg->uid);
if (err != MS_MEDIA_ERR_NONE) {
thumb_err("_media_thumb_update_db failed : %d", err);
res_msg->status = err;
diff --git a/src/include/util/media-thumb-db.h b/src/include/util/media-thumb-db.h
index f5020c0..6156d10 100755
--- a/src/include/util/media-thumb-db.h
+++ b/src/include/util/media-thumb-db.h
@@ -31,10 +31,9 @@
#define SELECT_THUMB_BY_PATH "SELECT thumbnail_path, width, height 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';"
-#define UPDATE_THUMB_WH_BY_PATH "UPDATE media SET thumbnail_path = '%q', width=%d,height=%d 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_update_db(const char *origin_path, char *thumb_path, int width, int height, 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/util/media-thumb-db.c b/src/util/media-thumb-db.c
index ba24ed8..8527da0 100755
--- a/src/util/media-thumb-db.c
+++ b/src/util/media-thumb-db.c
@@ -77,18 +77,14 @@ int _media_thumb_get_thumb_from_db_with_size(const char *origin_path, char *thum
return MS_MEDIA_ERR_NONE;
}
-int _media_thumb_update_db(const char *origin_path, char *thumb_path, int width, int height, uid_t uid)
+int _media_thumb_update_db(const char *origin_path, char *thumb_path, uid_t uid)
{
int err = MS_MEDIA_ERR_NONE;
char *query_string = NULL;
thumb_retvm_if(!STRING_VALID(origin_path), MS_MEDIA_ERR_INVALID_PARAMETER, "Invalid origin_path");
- if (width > 0 && height > 0)
- query_string = sqlite3_mprintf(UPDATE_THUMB_WH_BY_PATH, thumb_path, width, height, origin_path);
- else
- query_string = sqlite3_mprintf(UPDATE_THUMB_BY_PATH, thumb_path, origin_path);
-
+ query_string = sqlite3_mprintf(UPDATE_THUMB_BY_PATH, thumb_path, origin_path);
thumb_retvm_if(!STRING_VALID(query_string), MS_MEDIA_ERR_OUT_OF_MEMORY, "Memory allocation is failed");
err = media_db_request_update_db(query_string, uid);