Replace mm_util_gif_save() to mm_util_gif_save_to_xxx() 39/240839/1
authorjiyong.min <jiyong.min@samsung.com>
Wed, 12 Aug 2020 05:02:01 +0000 (14:02 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Wed, 12 Aug 2020 05:02:01 +0000 (14:02 +0900)
Change-Id: I04f299ccebf1b773ef608e0ce25c6754adc82def

src/image_util_encode.c

index d4229d2..3323220 100644 (file)
@@ -746,34 +746,20 @@ int image_util_agif_encode_add_frame(image_util_agif_encode_h handle, image_util
 
 int image_util_agif_encode_save_to_file(image_util_agif_encode_h handle, const char *file_path)
 {
-       int ret = IMAGE_UTIL_ERROR_NONE;
        mm_gif_file_h _handle = (mm_gif_file_h)handle;
 
        image_util_retvm_if(!_handle, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid Handle");
 
-       ret = mm_util_gif_encode_set_file(_handle, file_path);
-       image_util_retvm_if(ret != MM_UTIL_ERROR_NONE, _image_error_capi(ret), "mm_util_gif_encode_set_file is failed (%d)", ret);
-
-       ret = mm_util_gif_encode_save(_handle);
-       image_util_retvm_if(ret != MM_UTIL_ERROR_NONE, _image_error_capi(ret), "mm_util_gif_encode_save is failed (%d)", ret);
-
-       return ret;
+       return _image_error_capi(mm_util_gif_encode_save_to_file(_handle, file_path));
 }
 
 int image_util_agif_encode_save_to_buffer(image_util_agif_encode_h handle, unsigned char **buffer, size_t *buffer_size)
 {
-       int ret = IMAGE_UTIL_ERROR_NONE;
        mm_gif_file_h _handle = (mm_gif_file_h)handle;
 
        image_util_retvm_if(!_handle, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid Handle");
 
-       ret = mm_util_gif_encode_set_mem(_handle, (void **)buffer, buffer_size);
-       image_util_retvm_if(ret != MM_UTIL_ERROR_NONE, _image_error_capi(ret), "mm_util_gif_encode_set_mem is failed (%d)", ret);
-
-       ret = mm_util_gif_encode_save(_handle);
-       image_util_retvm_if(ret != MM_UTIL_ERROR_NONE, _image_error_capi(ret), "mm_util_gif_encode_save is failed (%d)", ret);
-
-       return ret;
+       return _image_error_capi(mm_util_gif_encode_save_to_buffer(_handle, (void **)buffer, buffer_size));
 }
 
 int image_util_agif_encode_destroy(image_util_agif_encode_h handle)