Remove _image_util_check_resolution() API. check parameters directly 63/191663/1
authorhj kim <backto.kim@samsung.com>
Mon, 22 Oct 2018 04:38:47 +0000 (13:38 +0900)
committerhj kim <backto.kim@samsung.com>
Mon, 22 Oct 2018 04:38:47 +0000 (13:38 +0900)
Change-Id: Id590cef6dd0a89d78c8884775b812f011bf20285

include/image_util_private.h
src/image_util.c
src/image_util_encode.c
src/image_util_private.c

index 8610ef3..4c1a433 100755 (executable)
@@ -185,7 +185,6 @@ unsigned int get_number_of_colorspace(void);
 int convert_type_of_colorspace(const image_util_colorspace_e colorspace);
 int convert_type_of_colorspace_with_image_type(const image_util_colorspace_e colorspace, const image_util_type_e type);
 int _image_error_capi(int error_code);
-bool _image_util_check_resolution(int width, int height);
 
 /**
 * @}
index 510f251..b1befe1 100755 (executable)
@@ -522,7 +522,7 @@ int image_util_transform_set_resolution(transformation_h handle, unsigned int wi
 
        image_util_retvm_if((_handle == NULL), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid Handle");
        image_util_retvm_if((_handle->set_crop), IMAGE_UTIL_ERROR_INVALID_OPERATION, "Crop and Resize can't do at the same time");
-       image_util_retvm_if((_image_util_check_resolution(width, height) == false), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid resolution");
+       image_util_retvm_if((width == 0 || height == 0), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid resolution w : [%d] h : [%d]", width, height);
 
        _handle->dst_width = width;
        _handle->dst_height = height;
@@ -558,8 +558,7 @@ int image_util_transform_set_crop_area(transformation_h handle, unsigned int sta
        dest_height = end_y - start_y;
 
        image_util_debug("Set crop_info x[%d] y[%d] w[%d] h[%d]", start_x, start_y, dest_width, dest_height);
-
-       image_util_retvm_if((_image_util_check_resolution(dest_width, dest_height) == false), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid dest resolution");
+       image_util_retvm_if((dest_width <= 0 || dest_height <= 0), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid resolution w : [%d] h : [%d]", dest_width, dest_height);
 
        _handle->start_x = start_x;
        _handle->start_y = start_y;
index 98cb644..168c266 100755 (executable)
@@ -115,7 +115,7 @@ int image_util_encode_set_resolution(image_util_encode_h handle, unsigned long w
        encode_s *_handle = (encode_s *) handle;
 
        image_util_retvm_if(_handle == NULL, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid Handle");
-       image_util_retvm_if((width == 0 || height == 0), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid resolution");
+       image_util_retvm_if((width == 0 || height == 0), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid resolution w : [%d] h : [%d]", width, height);
 
        /* multi-src for a-gif */
        if (_handle->image_type == IMAGE_UTIL_GIF) {
index dba91d4..efcc59a 100755 (executable)
@@ -216,18 +216,3 @@ int _image_error_capi(int error_code)
        return IMAGE_UTIL_ERROR_INVALID_OPERATION;
 
 }
-
-bool _image_util_check_resolution(int width, int height)
-{
-       if (width <= 0) {
-               image_util_error("invalid width [%d]", width);
-               return false;
-       }
-
-       if (height <= 0) {
-               image_util_error("invalid height [%d]", height);
-               return false;
-       }
-
-       return true;
-}