From: hj kim Date: Mon, 15 Oct 2018 05:28:31 +0000 (+0900) Subject: Remove _image_util_decode_create_image_handle(). because it just set default down_sca... X-Git-Tag: submit/tizen/20181106.000712^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c314273dcca5b2b33f5342c630b925eaf53c8e89;p=platform%2Fcore%2Fapi%2Fimage-util.git Remove _image_util_decode_create_image_handle(). because it just set default down_scale value. so I move it to image_util_decode_create() API Change-Id: Ifae5851bf59e87de843397d08e07081872702fe6 --- diff --git a/src/image_util_decode.c b/src/image_util_decode.c index 5eac0e3..10208b9 100755 --- a/src/image_util_decode.c +++ b/src/image_util_decode.c @@ -119,37 +119,13 @@ int image_util_decode_create(image_util_decode_h * handle) _handle->path = NULL; _handle->image_type = _NOT_SUPPORTED_IMAGE_TYPE; _handle->colorspace = IMAGE_UTIL_COLORSPACE_RGBA8888; + _handle->down_scale = IMAGE_UTIL_DOWNSCALE_1_1; *handle = (image_util_decode_h) _handle; return IMAGE_UTIL_ERROR_NONE; } -static int _image_util_decode_create_image_handle(image_util_decode_h handle) -{ - int err = IMAGE_UTIL_ERROR_NONE; - decode_s *_handle = (decode_s *) handle; - - switch (_handle->image_type) { - case IMAGE_UTIL_JPEG: - _handle->down_scale = IMAGE_UTIL_DOWNSCALE_1_1; - break; - case IMAGE_UTIL_PNG: - case IMAGE_UTIL_GIF: - case IMAGE_UTIL_BMP: - /* do nothing... */ - break; - default: - err = IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT; - break; - } - - if (err != IMAGE_UTIL_ERROR_NONE) - image_util_error("Error - create image handle"); - - return err; -} - int image_util_decode_set_input_path(image_util_decode_h handle, const char *path) { int err = IMAGE_UTIL_ERROR_NONE; @@ -173,9 +149,6 @@ int image_util_decode_set_input_path(image_util_decode_h handle, const char *pat IMAGE_UTIL_SAFE_FREE(image_header); - err = _image_util_decode_create_image_handle(_handle); - image_util_retvm_if((err != IMAGE_UTIL_ERROR_NONE), err, "_image_util_decode_create_image_handle failed"); - _handle->path = g_strndup(path, strlen(path)); image_util_retvm_if(_handle->path == NULL, IMAGE_UTIL_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); @@ -194,9 +167,6 @@ int image_util_decode_set_input_buffer(image_util_decode_h handle, const unsigne err = _image_util_decode_check_image_type(src_buffer, &_handle->image_type); image_util_retvm_if(err != IMAGE_UTIL_ERROR_NONE, err, "_image_util_decode_check_image_type failed"); - err = _image_util_decode_create_image_handle(_handle); - image_util_retvm_if(err != IMAGE_UTIL_ERROR_NONE, err, "_image_util_decode_create_image_handle failed"); - IMAGE_UTIL_SAFE_FREE(_handle->src_buffer); _handle->src_buffer = (void *)calloc(1, sizeof(void *));