Remove _image_util_decode_create_image_handle(). because it just set default down_sca... 53/191253/1
authorhj kim <backto.kim@samsung.com>
Mon, 15 Oct 2018 05:28:31 +0000 (14:28 +0900)
committerhj kim <backto.kim@samsung.com>
Mon, 15 Oct 2018 05:28:31 +0000 (14:28 +0900)
Change-Id: Ifae5851bf59e87de843397d08e07081872702fe6

src/image_util_decode.c

index 5eac0e3..10208b9 100755 (executable)
@@ -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 *));