Add to convert RGBA to BGRA for raw data 62/288562/3 accepted/tizen_6.0_unified tizen_6.0 accepted/tizen/6.0/unified/20230220.080831 submit/tizen_6.0/20230220.044710
authorjiyong.min <jiyong.min@samsung.com>
Mon, 20 Feb 2023 03:57:22 +0000 (12:57 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Mon, 20 Feb 2023 04:27:05 +0000 (13:27 +0900)
 - 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

packaging/libmedia-thumbnail.spec
src/media-thumbnail.c

index 0aa7db82127839e554010d29c0b46d92a720bf66..6871a88bc3a185c6a63d86f33990159765ab8cbc 100644 (file)
@@ -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
index d95a455db1b0a8ae215d7273d18ece9c186277de..e717bfb35381044c984f6323e03ac2bae79a6723 100755 (executable)
@@ -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)