diff options
author | Minje Ahn <minje.ahn@samsung.com> | 2018-01-31 13:22:50 +0900 |
---|---|---|
committer | Minje ahn <minje.ahn@samsung.com> | 2018-01-31 06:11:14 +0000 |
commit | 5db1a5e180bf6761b3cf814d055b7ff34f20e26d (patch) | |
tree | 4bc81f44736c4343fe830934637d7c3808512e3b /src/media-thumb-internal.c | |
parent | 96113cadb625d3960d04910107bd6c51153ed420 (diff) | |
download | libmedia-thumbnail-5db1a5e180bf6761b3cf814d055b7ff34f20e26d.tar.gz libmedia-thumbnail-5db1a5e180bf6761b3cf814d055b7ff34f20e26d.tar.bz2 libmedia-thumbnail-5db1a5e180bf6761b3cf814d055b7ff34f20e26d.zip |
Thumbnail-server code refactoring
Remove the code related with agif
Refactoring functions for getting media type and original w/h
Remove unused dependency
Change-Id: I08162ecfd41e1e3dd25833bf625d3206639d1e32
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'src/media-thumb-internal.c')
-rwxr-xr-x | src/media-thumb-internal.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/media-thumb-internal.c b/src/media-thumb-internal.c index ae46eeb..693293a 100755 --- a/src/media-thumb-internal.c +++ b/src/media-thumb-internal.c @@ -24,12 +24,6 @@ #include "media-thumb-internal.h" #include "media-thumb-ipc.h" -#include "AGifFrameInfo.h" -#include "IfegDecodeAGIF.h" -#include "img-codec.h" -#include "img-codec-agif.h" -#include "img-codec-common.h" -#include "img-codec-osal.h" #include "img-codec-parser.h" #include <sys/types.h> @@ -41,12 +35,11 @@ int _media_thumb_get_proper_thumb_size(int orig_w, int orig_h, int *thumb_w, int *thumb_h) { - BOOL portrait = FALSE; + bool portrait = false; double ratio; - if (orig_w < orig_h) { - portrait = TRUE; - } + if (orig_w < orig_h) + portrait = true; /* Set smaller length to default size */ if (portrait) { @@ -105,9 +98,10 @@ int _media_thumb_image(const char *origin_path, char *thumb_path, int thumb_widt unsigned int origin_w = 0; unsigned int origin_h = 0; - err = ImgGetImageInfoForThumb(origin_path, &image_type, &origin_w, &origin_h); + err = ImgGetImageInfo(origin_path, &image_type, &origin_w, &origin_h); if (err != MS_MEDIA_ERR_NONE) { thumb_warn("Getting image info is failed err: %d", err); + return MS_MEDIA_ERR_INTERNAL; } if ((image_type != IMG_CODEC_JPEG) && (origin_w * origin_h > THUMB_MAX_ALLOWED_MEM_FOR_THUMB)) { @@ -174,15 +168,14 @@ int _media_thumb_video(const char *origin_path, const char *thumb_path, int thum if (p == NULL) { rot_type = MM_UTIL_ROTATE_0; } else { - if (strncmp(p, "90", size) == 0) { + if (strncmp(p, "90", size) == 0) rot_type = MM_UTIL_ROTATE_90; - } else if (strncmp(p, "180", size) == 0) { + else if (strncmp(p, "180", size) == 0) rot_type = MM_UTIL_ROTATE_180; - } else if (strncmp(p, "270", size) == 0) { + else if (strncmp(p, "270", size) == 0) rot_type = MM_UTIL_ROTATE_270; - } else { + else rot_type = MM_UTIL_ROTATE_0; - } } thumb_dbg("There is tag rotate : %d", rot_type); } else { @@ -196,7 +189,6 @@ int _media_thumb_video(const char *origin_path, const char *thumb_path, int thum cdis_value = 0; SAFE_FREE(err_msg); } - } else { rot_type = MM_UTIL_ROTATE_0; cdis_value = 0; |