* @description Called when transform is finished just before returning the output.
* @parameter[IN] The error code of image-util transfrom
* @parameter[IN] Media packet handle
-* @parameter[IN] The user data passed from the for each function
+* @parameter[IN] The user data passed from the for each function
* @return NA
*/
void Image_util_transform_completed_CallBack(media_packet_h *packet, int error_code, void *user_data)
* @description Create and Destroy a handle to image-util transform.
* @scenario Creates a handle to image-util transform\n
* Destroy handle to image-util transform.
-* @apicovered image_util_transform_create, image_util_transform_destroy
+* @apicovered image_util_transform_create, image_util_transform_destroy
* @passcase When image_util_transform_create and image_util_transform_destory are successful.
* @failcase If target API image_util_transform_create or image_util_transform_destory or any precondition API fails.
* @precondition NA
* To Set the information of the converting\n
* To get the information of the converting\n
* Destroy handle to image-util transform.
-* @apicovered image_util_transform_set_crop_area,image_util_transform_get_colorspace,image_util_transform_set_colorspace
+* @apicovered image_util_transform_set_crop_area,image_util_transform_get_colorspace,image_util_transform_set_colorspace
* @passcase When image_util_transform_get_colorspace and image_util_transform_set_colorspace are successful.
* @failcase If target API image_util_transform_get_colorspace or image_util_transform_set_colorspace or any precondition API fails.
* @precondition image_util_transform_create, image_util_transform_set_crop_area must be called
* @author SRID(sk.roy)
* @reviewer SRID(gupta.sanjay)
* @type auto
-* @description To Set and Get the information of the cropping
+* @description To Set and Get the information of the cropping
* @scenario Create a handle to image-util transform\n
* Set the startX startY endX endY positions of cropped image buffer\n
* Get the startX startY endX endY positions of cropped image buffer\n
* Destroy handle to image-util transform.
-* @apicovered image_util_transform_set_crop_area, image_util_transform_set_crop_area
+* @apicovered image_util_transform_set_crop_area, image_util_transform_set_crop_area
* @passcase When image_util_transform_set_crop_area and image_util_transform_set_crop_area are successful.
* @failcase If target API image_util_transform_set_crop_area or image_util_transform_set_crop_area or any precondition API fails.
* @precondition NA
FPRINTF("\\n [Line : %d][%s] crop_area set and get values mismatch\\n", __LINE__, API_NAMESPACE);
return 1;
}
-
+
nRet = image_util_transform_destroy(stHandle);
PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_transform_destroy", ImageUtilGetError(nRet));
//& purpose: To Set and Get the resolution of the image buffer
//& type: auto
/**
-* @testcase ITc_image_util_transform_set_get_resolution_p
+* @testcase ITc_image_util_transform_set_get_resolution_p
* @since_tizen 2.3
-* @author SRID(sk.roy)
-* @reviewer SRID(gupta.sanjay)
+* @author SRID(sk.roy)
+* @reviewer SRID(gupta.sanjay)
* @type auto
* @description To Set and Get the resolution of the image buffer
* @scenario Create a handle to image-util transform\n
* Set the width and height of source image buffer\n
* Get the width and height of source image buffer\n
* Destroy handle to image-util transform.
-* @apicovered image_util_transform_set_resolution, image_util_transform_get_resolution
+* @apicovered image_util_transform_set_resolution, image_util_transform_get_resolution
* @passcase When image_util_transform_set_resolution and image_util_transform_get_resolution are successful.
* @failcase If target API image_util_transform_set_resolution or image_util_transform_get_resolution or any precondition API fails.
* @precondition NA
* Set rotation value of image buffer\n
* Get rotation value of image buffer\n
* Destroy handle to image-util transform.
-* @apicovered image_util_transform_set_rotation, image_util_transform_get_rotation
+* @apicovered image_util_transform_set_rotation, image_util_transform_get_rotation
* @passcase When image_util_transform_set_rotation and image_util_transform_get_rotation are successful.
* @failcase If target API image_util_transform_set_rotation or image_util_transform_get_rotation or any precondition API fails.
* @precondition NA
* @author SRID(sk.roy)
* @reviewer SRID(gupta.sanjay)
* @type auto
-* @description To Transform the image for given image-util handle.
+* @description To Transform the image for given image-util handle.
* @scenario Create a handle to image-util transform\n
* Media format is to be called\n
* image_util_transform_completed_cb callback is invoked\n
* Get rotation value of image buffer\n
* Destroy handle to image-util transform.
-* @apicovered image_util_transform_run
+* @apicovered image_util_transform_run
* @passcase When image_util_transform_run, media_format_create, media_format_set_video_mime, media_format_set_video_width
* media_format_set_video_height, media_format_set_video_avg_bps, media_format_set_video_max_bps,media_packet_create_alloc
* image_util_transform_set_resolution, media_packet_destroy,image_util_transform_destroy is successful.
}
//& purpose: To extract representative colour from an image buffer.
-//& type: auto
+//& type: auto
/**
* @testcase ITc_image_util_extract_color_from_memory_p
* @since_tizen 3.0
unsigned char rgb_r, rgb_g, rgb_b;
unsigned long long unDecodeSize = 0;
image_util_decode_h dstHandle = NULL;
+ image_util_image_h stDecodedImage = NULL;
unsigned long nDecWidth = 0;
unsigned long nDecHeight = 0;
nRet = image_util_decode_set_colorspace(dstHandle, IMAGE_UTIL_COLORSPACE_RGB888);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_colorspace", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
- nRet = image_util_decode_set_output_buffer(dstHandle, &puszImageSourceBuffer);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
-
- nRet = image_util_decode_run(dstHandle, &nDecWidth, &nDecHeight, &unDecodeSize);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
- CHECK_RETURN_CLEANUP(nWidth, "image_util_decode_run", image_util_decode_destroy(dstHandle));
- CHECK_RETURN_CLEANUP(nHeight, "image_util_decode_run", image_util_decode_destroy(dstHandle));
+ nRet = image_util_decode_run2(dstHandle, &stDecodedImage);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+ CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(dstHandle));
nRet = image_util_decode_destroy(dstHandle);
- PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+
+ nRet = image_util_get_image(stDecodedImage, &nDecWidth, &nDecHeight, NULL, &puszImageSourceBuffer, &unDecodeSize);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_get_image", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+ CHECK_HANDLE_CLEANUP(puszImageSourceBuffer, "image_util_get_image", image_util_destroy_image(stDecodedImage));
+
+ nRet = image_util_destroy_image(stDecodedImage);
+ PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
nWidth = (int)nDecWidth;
nWidth = (int)nDecHeight;
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_extract_color_from_memory", ImageUtilGetError(nRet), FREE_MEMORY(puszImageSourceBuffer));
FREE_MEMORY(puszImageSourceBuffer);
-
- return 0;
+
+ return 0;
}
//& purpose: To create and destroy a handle to image util decoding.
//& type: auto
* @author SRID(manu.tiwari)
* @reviewer SRID(parshant.v)
* @type auto
-* @description To create and destroy a handle to image util decoding.
+* @description To create and destroy a handle to image util decoding.
* @scenario Get the size of buffer\n
* Allocate it to image-util buffer
* @apicovered image_util_decode_create,image_util_decode_destroy
//& purpose: To set the input file path from which to decode.
//& type: auto
/**
-* @testcase ITc_image_util_decode_set_input_path_p
+* @testcase ITc_image_util_decode_set_input_path_p
* @since_tizen 3.0
-* @author SRID(manu.tiwari)
-* @reviewer SRID(parshant.v)
+* @author SRID(manu.tiwari)
+* @reviewer SRID(parshant.v)
* @type auto
-* @description To set the input file path from which to decode.
+* @description To set the input file path from which to decode.
* @scenario Get the size of buffer\n
* Allocate it to image-util buffer
* @apicovered image_util_decode_set_input_path
return 0;
}
-//& purpose: To create a handle to image util decoding.
-//& type: auto
+//& purpose: To create a handle to image util decoding.
+//& type: auto
/**
-* @testcase ITc_image_util_decode_set_input_buffer_p
+* @testcase ITc_image_util_decode_set_input_buffer_p
* @since_tizen 3.0
-* @author SRID(manu.tiwari)
-* @reviewer SRID(parshant.v)
+* @author SRID(manu.tiwari)
+* @reviewer SRID(parshant.v)
* @type auto
-* @description To set the input buffer to image util decoding.
+* @description To set the input buffer to image util decoding.
* @scenario To set the input buffer to image util decoding.
* @apicovered image_util_decode_set_input_buffer
* @passcase When image_util_decode_set_input_buffer is successful.
int ITc_image_util_decode_set_input_buffer_p(void)
{
START_TEST;
-
+
image_util_encode_h stEncHandle = NULL;
image_util_decode_h stDecHandle = NULL;
image_util_decode_h stDecodedHandle = NULL;
+ image_util_image_h stDecodedImage = NULL;
unsigned char *puszImageInputBuffer = NULL;
unsigned char *puszImageOutputbuffer = NULL;
unsigned long long nDecsize;
int nRet = image_util_decode_create(&stDecHandle);
PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
CHECK_HANDLE(stDecHandle,"image_util_decode_create");
-
+
char pPath[PATH_LEN] = {0,};
if ( false == ImageUtilAppendToAppDataPath(SAMPLE_FILE_PATH, pPath) )
{
nRet = image_util_decode_set_input_path(stDecHandle, pPath);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
- nRet = image_util_decode_set_output_buffer(stDecHandle, &puszImageOutputbuffer);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
-
- nRet = image_util_decode_run(stDecHandle, &nDecWidth, &nDecHeight, &nDecsize);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
+ nRet = image_util_decode_run2(stDecHandle, &stDecodedImage);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
+ CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(stDecHandle));
nRet = image_util_decode_destroy(stDecHandle);
- PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
-
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+
+ nRet = image_util_get_image(stDecodedImage, &nDecWidth, &nDecHeight, NULL, &puszImageOutputbuffer, &nDecsize);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_get_image", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+ CHECK_HANDLE_CLEANUP(puszImageOutputbuffer, "image_util_get_image", image_util_destroy_image(stDecodedImage));
+
+ nRet = image_util_destroy_image(stDecodedImage);
+ PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
+
nRet = image_util_encode_create(IMAGE_UTIL_PNG, &stEncHandle);
PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_create", ImageUtilGetError(nRet));
CHECK_HANDLE(stEncHandle,"image_util_encode_create");
-
+
nRet = image_util_encode_set_resolution(stEncHandle, nDecWidth, nDecHeight);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_resolution", ImageUtilGetError(nRet), image_util_encode_destroy(stEncHandle));
nRet = image_util_encode_set_output_buffer(stEncHandle, &puszImageInputBuffer);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_output_buffer", ImageUtilGetError(nRet), image_util_encode_destroy(stEncHandle));
-
+
nRet = image_util_encode_run(stEncHandle, &nEncsize);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_run", ImageUtilGetError(nRet), image_util_encode_destroy(stEncHandle));
return 0;
}
-//& purpose: To create a handle to image util decoding.
-//& type: auto
-/**
-* @testcase ITc_image_util_decode_set_output_buffer_p
-* @since_tizen 3.0
-* @author SRID(manu.tiwari)
-* @reviewer SRID(parshant.v)
-* @type auto
-* @description To set output buffer to image util decoding.
-* @scenario To set output buffer to image util decoding.
-* @apicovered image_util_decode_set_output_buffer
-* @passcase When image_util_decode_set_output_buffer is successful.
-* @failcase If target API image_util_decode_set_output_buffer fails or any precondition API fails.
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_image_util_decode_set_output_buffer_p(void)
-{
- START_TEST;
- image_util_decode_h stHandle = NULL;
- unsigned char *puszImageOutputBuffer = NULL;
-
- int nRet = image_util_decode_create(&stHandle);
- PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
- CHECK_HANDLE(stHandle,"image_util_decode_create");
- //target api
- nRet = image_util_decode_set_output_buffer(stHandle, &puszImageOutputBuffer);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
-
- nRet = image_util_decode_destroy(stHandle);
- PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
-
- return 0;
-}
-//& purpose: To create and destroy a handle to image util decoding.
-//& type: auto
+//& purpose: To create and destroy a handle to image util decoding.
+//& type: auto
/**
-* @testcase ITc_image_util_encode_create_destroy_p
+* @testcase ITc_image_util_encode_create_destroy_p
* @since_tizen 3.0
* @author SRID(manu.tiwari)
* @reviewer SRID(parshant.v)
* @type auto
-* @description To create and destroy a handle to image util encoding.
+* @description To create and destroy a handle to image util encoding.
* @scenario To create and destroy a handle to image util encoding
* @apicovered image_util_encode_create,image_util_encode_destroy
* @passcase When image_util_encode_create and image_util_encode_destroy is successful.
int ITc_image_util_encode_create_destroy_p(void)
{
START_TEST;
-
+
image_util_encode_h stHandle = NULL;
image_util_type_e eImageUtilType[] =
{
//& purpose: To create a handle to image util decoding.
//& type: auto
/**
-* @testcase ITc_image_util_encode_set_resolution_p
+* @testcase ITc_image_util_encode_set_resolution_p
* @since_tizen 3.0
-* @author SRID(manu.tiwari)
-* @reviewer SRID(parshant.v)
+* @author SRID(manu.tiwari)
+* @reviewer SRID(parshant.v)
* @type auto
* @description To set the resolution to image util decoding.
* @scenario To set the resolution to image util decoding.
/**
* @testcase ITc_image_util_encode_set_png_compression_p
* @since_tizen 3.0
-* @author SRID(manu.tiwari)
-* @reviewer SRID(parshant.v)
+* @author SRID(manu.tiwari)
+* @reviewer SRID(parshant.v)
* @type auto
* @description To set png compression to image util decoding.
* @scenario To set png compression to image util decoding
return 0;
}
-//& purpose: To create a handle to image util decoding.
-//& type: auto
+//& purpose: To create a handle to image util decoding.
+//& type: auto
/**
-* @testcase ITc_image_util_encode_set_input_buffer_p
+* @testcase ITc_image_util_encode_set_input_buffer_p
* @since_tizen 3.0
-* @author SRID(manu.tiwari)
-* @reviewer SRID(parshant.v)
+* @author SRID(manu.tiwari)
+* @reviewer SRID(parshant.v)
* @type auto
-* @description To set the input buffer to image util encoding.
-* @scenario To set the input buffer to image util encoding.
+* @description To set the input buffer to image util encoding.
+* @scenario To set the input buffer to image util encoding.
* @apicovered image_util_encode_set_input_buffer
* @passcase When image_util_encode_set_input_buffer is successful.
* @failcase If target API image_util_encode_set_input_buffer fails or any precondition API fails.
int ITc_image_util_encode_set_input_buffer_p(void)
{
START_TEST;
-
+
image_util_encode_h stEncHandle = NULL;
image_util_decode_h stDecHandle = NULL;
+ image_util_image_h stDecodedImage = NULL;
unsigned char *puszImageInputBuffer = NULL;
unsigned char *puszImageOutputbuffer = NULL;
unsigned long long nDecsize;
int nRet = image_util_decode_create(&stDecHandle);
PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
CHECK_HANDLE(stDecHandle,"image_util_decode_create");
-
+
char pPath[PATH_LEN] = {0,};
if ( false == ImageUtilAppendToAppDataPath(SAMPLE_FILE_PATH, pPath) )
{
nRet = image_util_decode_set_input_path(stDecHandle, pPath);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
- nRet = image_util_decode_set_output_buffer(stDecHandle, &puszImageOutputbuffer);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
-
- nRet = image_util_decode_run(stDecHandle, &nDecWidth, &nDecHeight, &nDecsize);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
+ nRet = image_util_decode_run2(stDecHandle, &stDecodedImage);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
+ CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(stDecHandle));
nRet = image_util_decode_destroy(stDecHandle);
- PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
-
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+
+ nRet = image_util_get_image(stDecodedImage, &nDecWidth, &nDecHeight, NULL, &puszImageOutputbuffer, &nDecsize);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_get_image", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+ CHECK_HANDLE_CLEANUP(puszImageOutputbuffer, "image_util_get_image", image_util_destroy_image(stDecodedImage));
+
+ nRet = image_util_destroy_image(stDecodedImage);
+ PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
+
nRet = image_util_encode_create(IMAGE_UTIL_PNG, &stEncHandle);
PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_create", ImageUtilGetError(nRet));
CHECK_HANDLE(stEncHandle,"image_util_encode_create");
-
+
nRet = image_util_encode_set_resolution(stEncHandle, nDecWidth, nDecHeight);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_resolution", ImageUtilGetError(nRet), image_util_encode_destroy(stEncHandle));
nRet = image_util_encode_set_output_buffer(stEncHandle, &puszImageInputBuffer);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_output_buffer", ImageUtilGetError(nRet), image_util_encode_destroy(stEncHandle));
-
+
nRet = image_util_encode_run(stEncHandle, &nEncsize);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_run", ImageUtilGetError(nRet), image_util_encode_destroy(stEncHandle));
//& purpose: To set the input file path from which to decode.
//& type: auto
/**
-* @testcase ITc_image_util_encode_set_output_path_p
+* @testcase ITc_image_util_encode_set_output_path_p
* @since_tizen 3.0
-* @author SRID(manu.tiwari)
-* @reviewer SRID(parshant.v)
+* @author SRID(manu.tiwari)
+* @reviewer SRID(parshant.v)
* @type auto
* @description To set the output file path from which to encode.
* @scenario To set the output file path from which to encode.
//& purpose: To create a handle to image util decoding.
//& type: auto
/**
-* @testcase ITc_image_util_encode_set_output_buffer_p
+* @testcase ITc_image_util_encode_set_output_buffer_p
* @since_tizen 3.0
-* @author SRID(manu.tiwari)
-* @reviewer SRID(parshant.v)
+* @author SRID(manu.tiwari)
+* @reviewer SRID(parshant.v)
* @type auto
-* @description To set output buffer to image util encoding.
-* @scenario To set output buffer to image util encoding.
+* @description To set output buffer to image util encoding.
+* @scenario To set output buffer to image util encoding.
* @apicovered image_util_encode_set_output_buffer
* @passcase When image_util_encode_set_output_buffer is successful.
* @failcase If target API image_util_encode_set_output_buffer fails or any precondition API fails.
START_TEST;
image_util_encode_h stHandle = NULL;
unsigned char *puszImageOutputBuffer = NULL;
-
+
int nRet = image_util_encode_create(IMAGE_UTIL_PNG, &stHandle);
PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_create", ImageUtilGetError(nRet));
CHECK_HANDLE(stHandle,"image_util_encode_create");
//target api
nRet = image_util_encode_set_output_buffer(stHandle, &puszImageOutputBuffer);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_output_buffer", ImageUtilGetError(nRet), image_util_encode_destroy(stHandle));
-
+
nRet = image_util_encode_destroy(stHandle);
PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_destroy", ImageUtilGetError(nRet));
return 0;
}
-//& purpose: To create a handle to image util decoding and encoding.
-//& type: auto
+//& purpose: To create a handle to image util encoding.
+//& type: auto
/**
-* @testcase ITc_image_util_decode_encode_run_p
+* @testcase ITc_image_util_encode_run_p
* @since_tizen 3.0
-* @author SRID(manu.tiwari)
-* @reviewer SRID(parshant.v)
+* @author SRID(manu.tiwari)
+* @reviewer SRID(parshant.v)
* @type auto
-* @description To run image util decoding and encoding.
-* @scenario To run image util decoding and encoding.
-* @apicovered image_util_encode_run,image_util_decode_run
-* @passcase When image_util_encode_run and image_util_decode_run is successful.
-* @failcase If target API image_util_encode_run and image_util_decode_run fails or any precondition API fails.
+* @description To run image util encoding.
+* @scenario To run image util encoding.
+* @apicovered image_util_encode_run
+* @passcase When image_util_encode_run is successful.
+* @failcase If target API image_util_encode_run fails or any precondition API fails.
* @precondition NA
* @postcondition NA
*/
-int ITc_image_util_decode_encode_run_p(void)
+int ITc_image_util_encode_run_p(void)
{
START_TEST;
image_util_encode_h stHandle = NULL;
unsigned char *puszImageOutputBuffer = NULL;
unsigned long long unSize = 0;
unsigned long unHeight = 16,unWidth = 9;
- image_util_decode_h dstHandle = NULL;
+ image_util_decode_h dstHandle = NULL;
+ image_util_image_h stDecodedImage = NULL;
unsigned long nWidth = 0, nHeight = 0;
int nRet = image_util_decode_create(&dstHandle);
PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
CHECK_HANDLE(dstHandle,"image_util_decode_create");
- nRet = image_util_decode_set_output_buffer(dstHandle, &puszImageOutputBuffer);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
-
char pPath[PATH_LEN] = {0,};
if ( false == ImageUtilAppendToAppDataPath(SAMPLE_FILE_PATH, pPath) )
{
- FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
- return 1;
+ FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+ return 1;
}
+
nRet = image_util_decode_set_input_path(dstHandle, pPath);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
- //target api
- nRet = image_util_decode_run(dstHandle, &nWidth, &nHeight, &unSize);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
- CHECK_RETURN_CLEANUP(nWidth, "image_util_decode_run", image_util_decode_destroy(dstHandle));
- CHECK_RETURN_CLEANUP(nHeight, "image_util_decode_run", image_util_decode_destroy(dstHandle));
- CHECK_RETURN_CLEANUP(unSize, "image_util_decode_run", image_util_decode_destroy(dstHandle));
+ nRet = image_util_decode_run2(dstHandle, &stDecodedImage);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+ CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(dstHandle));
nRet = image_util_decode_destroy(dstHandle);
- PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
-
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+
+ nRet = image_util_get_image(stDecodedImage, &nWidth, &nHeight, NULL, &puszImageOutputBuffer, &unSize);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_get_image", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+ CHECK_HANDLE_CLEANUP(puszImageOutputBuffer, "image_util_get_image", image_util_destroy_image(stDecodedImage));
+
+ nRet = image_util_destroy_image(stDecodedImage);
+ PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
+
nRet = image_util_encode_create(IMAGE_UTIL_PNG, &stHandle);
PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_create", ImageUtilGetError(nRet));
CHECK_HANDLE(stHandle,"image_util_encode_create");
-
+
nRet = image_util_encode_set_resolution(stHandle, unWidth, unHeight );
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_resolution", ImageUtilGetError(nRet), image_util_encode_destroy(stHandle));
nRet = image_util_encode_run(stHandle, &unSize);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_run", ImageUtilGetError(nRet), image_util_encode_destroy(stHandle));
CHECK_RETURN_CLEANUP(unSize, "image_util_encode_run", image_util_encode_destroy(stHandle));
-
+
nRet = image_util_encode_destroy(stHandle);
PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_destroy", ImageUtilGetError(nRet));
free(puszImageOutputBuffer);
return 0;
}
+
+//& purpose: To decode the image with the given decode handle.
+//& type: auto
+/**
+* @testcase ITc_image_util_encode_run_p
+* @since_tizen 5.5
+* @author SRID(karanam.s)
+* @reviewer SRID(manoj.g2)
+* @type auto
+* @description To decode the image with the given decode handle.
+* @scenario To decode the image with the given decode handle.
+* @apicovered image_util_decode_run2
+* @passcase When image_util_decode_run2 is successful.
+* @failcase If target API image_util_decode_run2 fails or any precondition API fails.
+* @precondition NA
+* @postcondition NA
+*/
+int ITc_image_util_decode_run2_p(void)
+{
+ START_TEST;
+ unsigned char *puszImageOutputBuffer = NULL;
+ image_util_decode_h dstHandle = NULL;
+ image_util_image_h stDecodedImage = NULL;
+
+ int nRet = image_util_decode_create(&dstHandle);
+ PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
+ CHECK_HANDLE(dstHandle,"image_util_decode_create");
+
+ char pPath[PATH_LEN] = {0,};
+ if ( false == ImageUtilAppendToAppDataPath(SAMPLE_FILE_PATH, pPath) )
+ {
+ FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+ return 1;
+ }
+
+ nRet = image_util_decode_set_input_path(dstHandle, pPath);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+
+ //target api
+ nRet = image_util_decode_run2(dstHandle, &stDecodedImage);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+ CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(dstHandle));
+
+ nRet = image_util_decode_destroy(dstHandle);
+ PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+ nRet = image_util_destroy_image(stDecodedImage);
+ PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
+ return 0;
+}
+
/**
-* @function Image_util_decode_completed_CallBack
+* @function Image_util_decode_completed2_CallBack
* @description Called when transform is finished just before returning the output.
* @parameter[IN] The error code of image-util transfrom
-* @parameter[IN] Media packet handle
-* @parameter[IN] The user data passed from the for each function
+* @parameter[IN] Media packet handle
+* @parameter[IN] The user data passed from the for each function
* @return NA
*/
-void Image_util_decode_completed_CallBack(int error_code, void *user_data, unsigned long width, unsigned long height, unsigned long long size)
+void Image_util_decode_completed2_CallBack(int error_code, image_util_image_h image, void *user_data)
{
g_bImageUtilDecodeCompletedCallback = true;
#if DEBUG
- FPRINTF("[Line : %d][%s] Image_util_decode_completed_CallBack is called\\n", __LINE__, API_NAMESPACE);
+ FPRINTF("[Line : %d][%s] Image_util_decode_completed2_CallBack is called\\n", __LINE__, API_NAMESPACE);
#endif
}
+
/**
* @function Image_util_encode_completed_CallBack
* @description Called when transform is finished just before returning the output.
* @parameter[IN] The error code of image-util transfrom
-* @parameter[IN] Media packet handle
-* @parameter[IN] The user data passed from the for each function
+* @parameter[IN] Media packet handle
+* @parameter[IN] The user data passed from the for each function
* @return NA
*/
void Image_util_encode_completed_CallBack(int error_code, void *user_data, unsigned long long size)
g_bImageUtilEncodeCompletedCallback = true;
#if DEBUG
FPRINTF("[Line : %d][%s] Image_util_encode_completed_CallBack is called\\n", __LINE__, API_NAMESPACE);
-#endif
+#endif
}
-//& purpose: To create a handle to image util decoding.
+
+//& purpose: To start encoding of the image and fill the output buffer.
//& type: auto
/**
-* @testcase ITc_image_util_decode_encode_run_async_p
+* @testcase ITc_image_util_encode_run_async_p
* @since_tizen 3.0
-* @author SRID(manu.tiwari)
-* @reviewer SRID(parshant.v)
+* @author SRID(manu.tiwari)
+* @reviewer SRID(parshant.v)
* @type auto
-* @description To run image_util_decode_encode_run_async.
-* @scenario To run image_util_decode_encode_run_async.
-* @apicovered image_util_encode_run_async,image_util_decode_run_async
-* @passcase When image_util_encode_run_async,image_util_decode_run_async is successful.
-* @failcase If target API image_util_encode_run_async or image_util_decode_run_async fails or any precondition API fails.
+* @description To create a handle to image util encoding.
+* @scenario To create a handle to image util encoding.
+* @apicovered image_util_encode_run_async
+* @passcase When image_util_encode_run_async is successful.
+* @failcase If target API image_util_encode_run_async fails or any precondition API fails.
* @precondition NA
* @postcondition NA
*/
-int ITc_image_util_decode_encode_run_async_p(void)
+int ITc_image_util_encode_run_async_p(void)
{
START_TEST;
image_util_encode_h stHandle = NULL;
unsigned char *puszImageInputBuffer = NULL;
unsigned long unHeight = 16,unWidth = 9;
image_util_decode_h dstHandle = NULL;
+ image_util_image_h stDecodedImage = NULL;
+ unsigned long nDecWidth = 0, nDecHeight = 0, nDecsize = 0;
int nRet = image_util_decode_create(&dstHandle);
PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
nRet = image_util_decode_set_input_path(dstHandle, pPath);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
- nRet = image_util_decode_set_output_buffer(dstHandle, &puszImageOutputBuffer);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+ nRet = image_util_decode_run2(dstHandle, &stDecodedImage);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+ CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(dstHandle));
+
g_bImageUtilDecodeCompletedCallback = false;
//target api
- nRet = image_util_decode_run_async(dstHandle, (image_util_decode_completed_cb) Image_util_decode_completed_CallBack, NULL);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run_async", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+ nRet = image_util_decode_run_async2(dstHandle, (image_util_decode_completed2_cb) Image_util_decode_completed2_CallBack, NULL);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run_async2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
wait_for_async();
if ( !g_bImageUtilDecodeCompletedCallback )
{
- FPRINTF("[Line : %d][%s] Image_util_decode_completed_CallBack failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
+ FPRINTF("[Line : %d][%s] Image_util_decode_completed2_CallBack failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
nRet = image_util_decode_destroy(dstHandle);
PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+ nRet = image_util_destroy_image(stDecodedImage);
+ PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
return 1;
}
else
{
#if DEBUG
- FPRINTF("[Line : %d][%s] image_util_decode_run_async is successful\\n", __LINE__, API_NAMESPACE);
+ FPRINTF("[Line : %d][%s] image_util_decode_run_async2 is successful\\n", __LINE__, API_NAMESPACE);
#endif
}
nRet = image_util_decode_destroy(dstHandle);
- PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+
+ nRet = image_util_get_image(stDecodedImage, &nDecWidth, &nDecHeight, NULL, &puszImageOutputBuffer, &nDecsize);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_get_image", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+ CHECK_HANDLE_CLEANUP(puszImageOutputBuffer, "image_util_get_image", image_util_destroy_image(stDecodedImage));
+
+ nRet = image_util_destroy_image(stDecodedImage);
+ PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
nRet = image_util_encode_create(IMAGE_UTIL_PNG, &stHandle);
PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_create", ImageUtilGetError(nRet));
free(puszImageOutputBuffer);
return 0;
}
+
+//& purpose: To start decoding of the image with the given decode handle.
+//& type: auto
+/**
+* @testcase ITc_image_util_decode_run_async2_p
+* @since_tizen 5.5
+* @author SRID(karanam.s)
+* @reviewer SRID(manoj.g2)
+* @type auto
+* @description To start decoding of the image with the given decode handle.
+* @scenario To start decoding of the image with the given decode handle.
+* @apicovered image_util_decode_run_async2
+* @passcase When image_util_decode_run_async2 is successful.
+* @failcase If target API image_util_decode_run_async2 fails or any precondition API fails.
+* @precondition Handle of image util decoding should be created.
+* @postcondition NA
+*/
+int ITc_image_util_decode_run_async2_p(void)
+{
+ START_TEST;
+ unsigned char *puszImageInputBuffer = NULL;
+ image_util_decode_h dstHandle = NULL;
+ image_util_image_h stDecodedImage = NULL;
+
+ int nRet = image_util_decode_create(&dstHandle);
+ PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
+ CHECK_HANDLE(dstHandle,"image_util_decode_create");
+
+ char pPath[PATH_LEN] = {0,};
+ if ( false == ImageUtilAppendToAppDataPath(SAMPLE_FILE_PATH, pPath) )
+ {
+ FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+ return 1;
+ }
+ nRet = image_util_decode_set_input_path(dstHandle, pPath);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+
+ nRet = image_util_decode_run2(dstHandle, &stDecodedImage);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+ CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(dstHandle));
+
+ g_bImageUtilDecodeCompletedCallback = false;
+ //target api
+ nRet = image_util_decode_run_async2(dstHandle, (image_util_decode_completed2_cb) Image_util_decode_completed2_CallBack, NULL);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run_async2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+ wait_for_async();
+
+ if ( !g_bImageUtilDecodeCompletedCallback )
+ {
+ FPRINTF("[Line : %d][%s] Image_util_decode_completed2_CallBack failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
+ nRet = image_util_decode_destroy(dstHandle);
+ PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+ nRet = image_util_destroy_image(stDecodedImage);
+ PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
+ return 1;
+ }
+ else
+ {
+ #if DEBUG
+ FPRINTF("[Line : %d][%s] image_util_decode_run_async2 is successful\\n", __LINE__, API_NAMESPACE);
+ #endif
+ }
+
+ nRet = image_util_decode_destroy(dstHandle);
+ PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+
+ nRet = image_util_destroy_image(stDecodedImage);
+ PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
+
+ return 0;
+}
+
/**
* @function Image_util_supported_colorspace_CallBack
* @description Called once for each supported image encode/decode colorspace.
nRet = image_util_decode_destroy(stHandle);
PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
-
+
return 0;
}
//& purpose: Sets the colorspace format for image encoding
* @reviewer SRID(parshant.v)
* @type auto
* @description Sets the colorspace format for image encoding
-* @scenario
+* @scenario
* @apicovered image_util_encode_set_colorspace
* @passcase When image_util_encode_set_colorspace is successful.
* @failcase If target API image_util_encode_set_colorspace fails or any precondition API fails.
* @reviewer SRID(parshant.v)
* @type auto
* @description Sets the downscale value at which JPEG image should be decoded.
-* @scenario
+* @scenario
* @apicovered image_util_decode_set_jpeg_downscale
* @passcase When image_util_decode_set_jpeg_downscale is successful.
* @failcase If target API image_util_decode_set_jpeg_downscale fails or any precondition API fails.
{
START_TEST;
image_util_decode_h stHandle = NULL;
-
+
int nRet = image_util_decode_create(&stHandle);
PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
CHECK_HANDLE(stHandle,"image_util_decode_create");
* @reviewer SRID(parshant.v)
* @type auto
* @description Sets the quality for JPEG image encoding.
-* @scenario
+* @scenario
* @apicovered image_util_encode_set_quality
* @passcase When image_util_encode_set_quality is successful.
* @failcase If target API image_util_encode_set_quality fails or any precondition API fails.
/**
* @testcase ITc_image_util_encode_set_gif_frame_delay_time_p
* @since_tizen 3.0
-* @author SRID(nibha.sharma)
+* @author SRID(nibha.sharma)
* @reviewer SRID(parshant.v)
* @type auto
* @description Sets the time delay between each frame in the encoded animated gif image
int nRet = image_util_encode_create(IMAGE_UTIL_GIF, &hImageHandle);
PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_create", ImageUtilGetError(nRet));
CHECK_HANDLE(hImageHandle,"image_util_encode_create");
-
-
+
+
//Target API
nRet = image_util_encode_set_gif_frame_delay_time(hImageHandle, nDelayTime);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_gif_frame_delay_time", ImageUtilGetError(nRet), image_util_encode_destroy(hImageHandle));