image_util_png_compression_e compression;
gif_encode_s gif_encode_info;
encode_cb_s *_encode_cb;
+ mm_util_enc_opt_h enc_opt;
/* for async */
GThread *thread;
_handle->quality = 75;
_handle->compression = IMAGE_UTIL_PNG_COMPRESSION_6;
+ err = mm_util_enc_opt_create(&_handle->enc_opt);
+ if (err != MM_UTIL_ERROR_NONE) {
+ image_util_error("Error - mm_util_enc_opt_create is failed (%d)", err);
+ image_util_encode_destroy(_handle);
+ return _image_error_capi(err);
+ }
+
+ err = mm_util_enc_opt_set_codec(_handle->enc_opt, image_type);
+ if (err != MM_UTIL_ERROR_NONE) {
+ image_util_error("Error - mm_util_enc_opt_set_codec is failed (%d)", err);
+ image_util_encode_destroy(_handle);
+ return _image_error_capi(err);
+ }
+
_handle->src.color = IMAGE_UTIL_COLORSPACE_RGBA8888;
_handle->thread = NULL;
case IMAGE_UTIL_BMP:
{
if (_handle->path)
- err = mm_util_encode_image_to_file(_src, _handle->path);
+ err = mm_util_encode_image_to_file(_src, _handle->enc_opt, _handle->path);
else
- err = mm_util_encode_image_to_buffer(_src, IMG_CODEC_BMP, _handle->dst_buffer, &_handle->dst_size);
+ err = mm_util_encode_image_to_buffer(_src, _handle->enc_opt, _handle->dst_buffer, &_handle->dst_size);
}
break;
default:
break;
case IMAGE_UTIL_BMP:
- ret = mm_util_encode_image_to_file(image, file_path);
+ ret = mm_util_encode_image_to_file(image, _handle->enc_opt, file_path);
break;
default:
break;
case IMAGE_UTIL_BMP:
- ret = mm_util_encode_image_to_buffer(image, IMG_CODEC_BMP, (void **)buffer, buffer_size);
+ ret = mm_util_encode_image_to_buffer(image, _handle->enc_opt, (void **)buffer, buffer_size);
break;
default:
return IMAGE_UTIL_ERROR_INVALID_PARAMETER;
__free_source_buffer(_handle);
+ mm_util_enc_opt_destroy(_handle->enc_opt);
+
g_free(_handle->path);
g_free(_handle);