diff options
author | jiyong.min <jiyong.min@samsung.com> | 2023-02-20 12:57:22 +0900 |
---|---|---|
committer | jiyong.min <jiyong.min@samsung.com> | 2023-02-20 13:27:05 +0900 |
commit | 0bc64ba8d23e0e2f493f8c4415fa1ce0e72bb515 (patch) | |
tree | cccc0c7f755911f8ac4790a0a7cc127cf39e8e22 | |
parent | acfb6d0101a2688d30dc7b4692c257ba907330a1 (diff) | |
download | libmedia-thumbnail-0bc64ba8d23e0e2f493f8c4415fa1ce0e72bb515.tar.gz libmedia-thumbnail-0bc64ba8d23e0e2f493f8c4415fa1ce0e72bb515.tar.bz2 libmedia-thumbnail-0bc64ba8d23e0e2f493f8c4415fa1ce0e72bb515.zip |
Add to convert RGBA to BGRA for raw datasubmit/tizen_6.0/20230220.044710accepted/tizen/6.0/unified/20230220.080831tizen_6.0accepted/tizen_6.0_unified
- In case of raw data, if it is an image,
thumbnail should be returned as BGRA colorspace.
https://docs.tizen.org/application/native/guides/multimedia/thumbnail-images/
Change-Id: I11065190336962db66f228d6d93279dd180e2e6e
-rw-r--r-- | packaging/libmedia-thumbnail.spec | 2 | ||||
-rwxr-xr-x | src/media-thumbnail.c | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/packaging/libmedia-thumbnail.spec b/packaging/libmedia-thumbnail.spec index 0aa7db8..6871a88 100644 --- a/packaging/libmedia-thumbnail.spec +++ b/packaging/libmedia-thumbnail.spec @@ -1,6 +1,6 @@ Name: libmedia-thumbnail Summary: Media thumbnail service library for multimedia applications -Version: 0.3.6 +Version: 0.3.7 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 and PD diff --git a/src/media-thumbnail.c b/src/media-thumbnail.c index d95a455..e717bfb 100755 --- a/src/media-thumbnail.c +++ b/src/media-thumbnail.c @@ -608,14 +608,19 @@ static int __create_gif_thumbnail_to_buffer(const char *path, unsigned int thumb { int err = MS_MEDIA_ERR_NONE; mm_util_image_h decode_image = NULL; + mm_util_image_h rgba_thumbnail = NULL; err = mm_util_decode_from_gif_file(path, &decode_image); thumb_retvm_if(err != MM_UTIL_ERROR_NONE, MS_MEDIA_ERR_INTERNAL, "mm_util_decode_from_gif_file failed : %d", err); - err = mm_util_resize_B_B(decode_image, thumb_w, thumb_h, thumbnail); + err = mm_util_resize_B_B(decode_image, thumb_w, thumb_h, &rgba_thumbnail); mm_image_destroy_image(decode_image); thumb_retvm_if(err != MM_UTIL_ERROR_NONE, MS_MEDIA_ERR_INTERNAL, "mm_util_resize_B_B failed : %d", err); + err = mm_util_convert_B_B(rgba_thumbnail, MM_UTIL_COLOR_BGRA, thumbnail); + mm_image_destroy_image(rgba_thumbnail); + thumb_retvm_if(err != MM_UTIL_ERROR_NONE, MS_MEDIA_ERR_INTERNAL, "mm_util_convert_B_B failed : %d", err); + return MS_MEDIA_ERR_NONE; } @@ -633,7 +638,7 @@ static int __decode_jpeg_with_downscale(const char *path, size_t image_size, siz thumb_info("downscale: %d", downscale); - return mm_util_decode_from_jpeg_file(path, MM_UTIL_COLOR_RGB24, downscale, decode_image); + return mm_util_decode_from_jpeg_file(path, MM_UTIL_COLOR_BGRA, downscale, decode_image); } static int __create_jpeg_thumbnail_to_file(const char *path, size_t image_size, unsigned int thumb_w, unsigned int thumb_h, const char *thumb_path, bool auto_rotate) |