char *type_str = NULL;
if (CONTACTS_EMAIL_TYPE_HOME == type) {
type_str = "HOME";
- }
+ }
/* LCOV_EXCL_START */
else if (CONTACTS_EMAIL_TYPE_WORK == type) {
type_str = "WORK";
if (CONTACTS_URL_TYPE_HOME == type) {
type_str = "HOME";
- }
+ }
/* LCOV_EXCL_START */
else if (CONTACTS_URL_TYPE_WORK == type) {
type_str = "WORK";
}
image_util_decode_h dh = NULL;
+ image_util_image_h decoded_image = NULL;
do {
- unsigned long l_width = 0;
- unsigned long l_height = 0;
- unsigned long long ll_size_decode = 0;
+ unsigned int _width = 0;
+ unsigned int _height = 0;
+ size_t _size_decode = 0;
ret = image_util_decode_create(&dh);
if (IMAGE_UTIL_ERROR_NONE != ret)
ret = image_util_decode_set_colorspace(dh, colorspace);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
- ret = image_util_decode_set_output_buffer(dh, (unsigned char **)&buffer);
+ ret = image_util_decode_run2(dh, &decoded_image);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
- ret = image_util_decode_run(dh, &l_width, &l_height, &ll_size_decode);
+ ret = image_util_get_image(decoded_image, &_width, &_height, NULL, &buffer, &_size_decode);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
- width = (int)l_width;
- height = (int)l_height;
- size_decode = (unsigned int)ll_size_decode;
+ width = (int)_width;
+ height = (int)_height;
+ size_decode = (unsigned int)_size_decode;
} while (0);
if (dh)
ret = image_util_decode_destroy(dh);
+
+ if (decoded_image)
+ ret = image_util_destroy_image(decoded_image);
+
if (IMAGE_UTIL_ERROR_NONE != ret || 0 == width || 0 == height) {
/* LCOV_EXCL_START */
info->ret = CONTACTS_ERROR_SYSTEM;
}
image_util_encode_h eh = NULL;
+ image_util_image_h image = NULL;
do {
- unsigned long long ll_size_encode = 0;
+ size_t size_encode = 0;
- ret = image_util_encode_create(IMAGE_UTIL_JPEG, &eh);
- if (IMAGE_UTIL_ERROR_NONE != ret)
- break;
- ret = image_util_encode_set_input_buffer(eh, buffer);
+ ret = image_util_create_image(width, height, colorspace, buffer, size, &image);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
- ret = image_util_encode_set_resolution(eh, width, height);
- if (IMAGE_UTIL_ERROR_NONE != ret)
- break;
- ret = image_util_encode_set_colorspace(eh, colorspace);
+
+ ret = image_util_encode_create(IMAGE_UTIL_JPEG, &eh);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
ret = image_util_encode_set_quality(eh, CTSVC_IMAGE_ENCODE_QUALITY);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
- ret = image_util_encode_set_output_buffer(eh, info->image);
+ ret = image_util_encode_run_to_buffer(eh, image, info->image, &size_encode);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
- ret = image_util_encode_run(eh, &ll_size_encode);
- *(info->image_size) = (unsigned int)ll_size_encode;
+ *(info->image_size) = (unsigned int)size_encode;
} while (0);
+
+ if (image)
+ image_util_destroy_image(image);
+
if (eh)
ret = image_util_encode_destroy(eh);
free(buffer);
}
image_util_decode_h dh = NULL;
+ image_util_image_h decoded_image = NULL;
do {
- unsigned long l_width = 0;
- unsigned long l_height = 0;
- unsigned long long ll_size_decode = 0;
+ unsigned int _width = 0;
+ unsigned int _height = 0;
+ size_t _size_decode = 0;
ret = image_util_decode_create(&dh);
if (IMAGE_UTIL_ERROR_NONE != ret)
ret = image_util_decode_set_colorspace(dh, colorspace);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
- ret = image_util_decode_set_output_buffer(dh, (unsigned char **)&buffer);
+ ret = image_util_decode_run2(dh, &decoded_image);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
- ret = image_util_decode_run(dh, &l_width, &l_height, &ll_size_decode);
+ image_util_get_image(decoded_image, &_width, &_height, NULL, &buffer, &_size_decode);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
- width = (int)l_width;
- height = (int)l_height;
- size_decode = (unsigned int)ll_size_decode;
+ width = (int)_width;
+ height = (int)_height;
+ size_decode = (unsigned int)_size_decode;
} while (0);
if (dh)
ret = image_util_decode_destroy(dh);
+
+ if (decoded_image)
+ ret = image_util_destroy_image(decoded_image);
+
if (IMAGE_UTIL_ERROR_NONE != ret || 0 == width || 0 == height) {
/* LCOV_EXCL_START */
info->ret = CONTACTS_ERROR_SYSTEM;
}
image_util_encode_h eh = NULL;
+ image_util_image_h image = NULL;
do {
- unsigned long long ll_size_encode = 0;
-
- ret = image_util_encode_create(IMAGE_UTIL_JPEG, &eh);
- if (IMAGE_UTIL_ERROR_NONE != ret)
- break;
- ret = image_util_encode_set_input_buffer(eh, buffer);
+ ret = image_util_create_image(width, height, colorspace, buffer, size, &image);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
- ret = image_util_encode_set_resolution(eh, width, height);
- if (IMAGE_UTIL_ERROR_NONE != ret)
- break;
- ret = image_util_encode_set_colorspace(eh, colorspace);
+ ret = image_util_encode_create(IMAGE_UTIL_JPEG, &eh);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
ret = image_util_encode_set_quality(eh, CTSVC_IMAGE_ENCODE_QUALITY);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
- ret = image_util_encode_set_output_path(eh, info->dest);
+ ret = image_util_encode_run_to_file(eh, image, info->dest);
if (IMAGE_UTIL_ERROR_NONE != ret)
break;
- ret = image_util_encode_run(eh, &ll_size_encode);
} while (0);
+
+ if (image)
+ image_util_destroy_image(image);
+
if (eh)
ret = image_util_encode_destroy(eh);
free(buffer);