From: jiyong.min Date: Mon, 5 Apr 2021 08:17:45 +0000 (+0900) Subject: fix incorrect parameters of mm_util_decode_image_xxx() X-Git-Tag: submit/tizen/20210405.083522^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af74d345751c0a3e53e040e21d38f045d85cd49e;p=platform%2Fcore%2Fapi%2Fimage-util.git fix incorrect parameters of mm_util_decode_image_xxx() changes for commit 68989f8cf89c8d4c29d57ba25775f05a04ad2359 Change-Id: I69146f19b6f48a94fcfd4102ad4d0f2f079c4375 --- diff --git a/packaging/capi-media-image-util.spec b/packaging/capi-media-image-util.spec index b10602f..cc5deca 100644 --- a/packaging/capi-media-image-util.spec +++ b/packaging/capi-media-image-util.spec @@ -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 diff --git a/src/image_util_decode.c b/src/image_util_decode.c index 53eb162..eccc00e 100644 --- a/src/image_util_decode.c +++ b/src/image_util_decode.c @@ -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: