fix incorrect parameters of mm_util_decode_image_xxx() 86/256486/2 accepted/tizen/6.5/unified/20211028.093957 accepted/tizen/unified/20210406.001533 submit/tizen/20210405.083522 submit/tizen_6.5/20211028.161701 tizen_6.5.m2_release
authorjiyong.min <jiyong.min@samsung.com>
Mon, 5 Apr 2021 08:17:45 +0000 (17:17 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Mon, 5 Apr 2021 08:26:25 +0000 (17:26 +0900)
 changes for commit 68989f8cf89c8d4c29d57ba25775f05a04ad2359

Change-Id: I69146f19b6f48a94fcfd4102ad4d0f2f079c4375

packaging/capi-media-image-util.spec
src/image_util_decode.c

index b10602f866aa512533770da47ca69a5b9ccdc0bf..cc5decabaa57c8866077661c9be02311dda7e3fb 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-image-util
 Summary:    A Image Utility library in Tizen Native API
-Version:    0.3.0
+Version:    0.3.1
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 53eb162d99e9e1275284f4fbe0d472b870982cff..eccc00ea1b6b5395667dcb900dd696729851b8c2 100644 (file)
@@ -259,10 +259,11 @@ static int __image_util_decode_internal(decode_s *_handle, mm_util_image_h *imag
 
        image_util_fenter();
 
+       colorspace = TYPECAST_COLOR_BY_TYPE(_handle->colorspace, _handle->image_type);
+
        switch (_handle->image_type) {
        case IMAGE_UTIL_JPEG:
                {
-                       colorspace = TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_JPEG);
                        downscale = _convert_decode_scale_tbl[_handle->down_scale];
 
                        if (_handle->path)
@@ -288,18 +289,18 @@ static int __image_util_decode_internal(decode_s *_handle, mm_util_image_h *imag
        case IMAGE_UTIL_WEBP:
                {
                        if (_handle->path)
-                               err = mm_util_decode_image_from_file(_handle->path, TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_WEBP), image_info);
+                               err = mm_util_decode_image_from_file(_handle->path, colorspace, image_info);
                        else
-                               err = mm_util_decode_image_from_buffer(_handle->src_buffer, TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_WEBP), _handle->colorspace, image_info);
+                               err = mm_util_decode_image_from_buffer(_handle->src_buffer, _handle->src_size, colorspace, image_info);
                }
                break;
 
        case IMAGE_UTIL_HEIF:
                {
                        if (_handle->path)
-                               err = mm_util_decode_heif_from_file(_handle->path, TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_HEIF), image_info);
+                               err = mm_util_decode_heif_from_file(_handle->path, colorspace, image_info);
                        else
-                               err = mm_util_decode_heif_from_buffer(_handle->src_buffer, _handle->src_size, TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_HEIF), image_info);
+                               err = mm_util_decode_heif_from_buffer(_handle->src_buffer, _handle->src_size, colorspace, image_info);
                }
                break;
 
@@ -370,10 +371,11 @@ static int __image_util_decode_run_from_file(image_util_decode_h handle, const c
        g_free(image_header);
        image_util_retvm_if((ret != IMAGE_UTIL_ERROR_NONE), ret, "__image_util_decode_check_image_type failed");
 
+       colorspace = TYPECAST_COLOR_BY_TYPE(_handle->colorspace, image_type);
+
        switch (image_type) {
        case IMAGE_UTIL_JPEG:
                {
-                       colorspace = TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_JPEG);
                        downscale = _convert_decode_scale_tbl[_handle->down_scale];
 
                        ret = mm_util_decode_from_jpeg_file(file_path, colorspace, downscale, image);
@@ -389,11 +391,11 @@ static int __image_util_decode_run_from_file(image_util_decode_h handle, const c
        case IMAGE_UTIL_BMP:
                /* fall through */
        case IMAGE_UTIL_WEBP:
-               ret = mm_util_decode_image_from_file(file_path, TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_WEBP), image);
+               ret = mm_util_decode_image_from_file(file_path, colorspace, image);
                break;
 
        case IMAGE_UTIL_HEIF:
-               ret = mm_util_decode_heif_from_file(file_path, TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_HEIF), image);
+               ret = mm_util_decode_heif_from_file(file_path, colorspace, image);
                break;
 
        default:
@@ -425,10 +427,11 @@ static int __image_util_decode_run_from_buffer(image_util_decode_h handle, const
        ret = __image_util_decode_check_image_type(buffer, &image_type);
        image_util_retvm_if(ret != IMAGE_UTIL_ERROR_NONE, ret, "__image_util_decode_check_image_type failed");
 
+       colorspace = TYPECAST_COLOR_BY_TYPE(_handle->colorspace, image_type);
+
        switch (image_type) {
        case IMAGE_UTIL_JPEG:
                {
-                       colorspace = TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_JPEG);
                        downscale = _convert_decode_scale_tbl[_handle->down_scale];
 
                        ret = mm_util_decode_from_jpeg_memory((void *)buffer, buffer_size, colorspace, downscale, image);
@@ -444,11 +447,11 @@ static int __image_util_decode_run_from_buffer(image_util_decode_h handle, const
        case IMAGE_UTIL_BMP:
                /* fall through */
        case IMAGE_UTIL_WEBP:
-               ret = mm_util_decode_image_from_buffer((void *)buffer, buffer_size, TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_WEBP), image);
+               ret = mm_util_decode_image_from_buffer((void *)buffer, buffer_size, colorspace, image);
                break;
 
        case IMAGE_UTIL_HEIF:
-               ret = mm_util_decode_heif_from_buffer((void *)buffer, buffer_size, TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_HEIF), image);
+               ret = mm_util_decode_heif_from_buffer((void *)buffer, buffer_size, colorspace, image);
                break;
 
        default: