summaryrefslogtreecommitdiff
path: root/src/media-thumb-internal.c
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2015-06-11 05:16:38 (GMT)
committerMinje Ahn <minje.ahn@samsung.com>2015-06-12 04:32:13 (GMT)
commita12bc773900c611d8ca0e159397f039fa588893d (patch)
tree04ab5a27bd40f5441ccb45c0ed01e746f846279c /src/media-thumb-internal.c
parentcbb11bf8d28059cdf57cea64a04150a740cbcf91 (diff)
downloadlibmedia-thumbnail-a12bc773900c611d8ca0e159397f039fa588893d.zip
libmedia-thumbnail-a12bc773900c611d8ca0e159397f039fa588893d.tar.gz
libmedia-thumbnail-a12bc773900c611d8ca0e159397f039fa588893d.tar.bz2
support thumbnail-util.refs/changes/54/41054/3
Change-Id: Ia218f4ef9ea66318eb67ed1fef2c6034044c18cb Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'src/media-thumb-internal.c')
-rwxr-xr-xsrc/media-thumb-internal.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/media-thumb-internal.c b/src/media-thumb-internal.c
index f7b764f..30e6f6b 100755
--- a/src/media-thumb-internal.c
+++ b/src/media-thumb-internal.c
@@ -887,11 +887,39 @@ int _media_thumb_jpeg(const char *origin_path,
return err;
}
+int _media_thumb_jpeg_for_raw(const char *origin_path,
+ int thumb_width,
+ int thumb_height,
+ media_thumb_format format,
+ media_thumb_info *thumb_info,
+ uid_t uid)
+{
+ int err = MS_MEDIA_ERR_NONE;
+ int orientation = NORMAL;
+
+ err = _media_thumb_decode_with_gdk(origin_path, thumb_width, thumb_height, thumb_info, 0, orientation);
+
+ if (err != MS_MEDIA_ERR_NONE) {
+ thumb_err("decode_with_gdk failed : %d", err);
+ return err;
+ }
+
+ err = _media_thumb_convert_format(thumb_info, MEDIA_THUMB_RGB888, format);
+ if (err != MS_MEDIA_ERR_NONE) {
+ thumb_err("_media_thumb_convert_format falied: %d", err);
+ SAFE_FREE(thumb_info->data);
+ return err;
+ }
+ return err;
+}
+
int _media_thumb_image(const char *origin_path,
int thumb_width,
int thumb_height,
media_thumb_format format,
- media_thumb_info *thumb_info, uid_t uid)
+ media_thumb_info *thumb_info,
+ bool is_raw,
+ uid_t uid)
{
int err = MS_MEDIA_ERR_NONE;
int image_type = 0;
@@ -915,7 +943,11 @@ int _media_thumb_image(const char *origin_path,
if (image_type == IMG_CODEC_AGIF) {
err = _media_thumb_agif(origin_path, &image_info, thumb_width, thumb_height, format, thumb_info);
} else if (image_type == IMG_CODEC_JPEG) {
- err = _media_thumb_jpeg(origin_path, thumb_width, thumb_height, format, thumb_info, uid);
+ if(is_raw) {
+ err = _media_thumb_jpeg_for_raw(origin_path, thumb_width, thumb_height, format, thumb_info, uid);
+ } else {
+ err = _media_thumb_jpeg(origin_path, thumb_width, thumb_height, format, thumb_info, uid);
+ }
} else if (image_type == IMG_CODEC_PNG) {
err = _media_thumb_png(origin_path, thumb_width, thumb_height, format, thumb_info);
} else if (image_type == IMG_CODEC_GIF) {