#define DECODE_IMAGE_TYPE_N IMAGE_UTIL_HEIF
#define ENCODE_IMAGE_TYPE_N IMAGE_UTIL_WEBP
-#define INVALID_IMAGE_TYPE ((DECODE_IMAGE_TYPE_N > ENCODE_IMAGE_TYPE_N) ? DECODE_IMAGE_TYPE_N * 2 : ENCODE_IMAGE_TYPE_N * 2)
+#define UTC_IMAGE_TYPE_N ((DECODE_IMAGE_TYPE_N > ENCODE_IMAGE_TYPE_N) ? DECODE_IMAGE_TYPE_N : ENCODE_IMAGE_TYPE_N)
+#define INVALID_IMAGE_TYPE (UTC_IMAGE_TYPE_N * 2)
typedef struct {
bool support_decode;
[IMAGE_UTIL_GIF] = { NULL, NULL, { NULL, 0, 0 } },
[IMAGE_UTIL_BMP] = { NULL, NULL, { NULL, 0, 0 } },
[IMAGE_UTIL_WEBP] = { NULL, NULL, { NULL, 0, 0 } },
+ [IMAGE_UTIL_HEIF] = { NULL, NULL, { NULL, 0, 0 } },
};
static int callback_error = IMAGE_UTIL_ERROR_NONE;
return ret;
}
-
static void __utc_decode_free()
{
image_util_type_e type = 0;
- for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
+ for (type = 0; type <= UTC_IMAGE_TYPE_N; type++) {
IMAGEUTIL_SAFE_G_FREE(utc_decode[type].result.buffer);
utc_decode[type].result.size = 0;
+ image_util_destroy_image(utc_decode[type].decoded);
+ utc_decode[type].decoded = NULL;
IMAGEUTIL_SAFE_G_FREE(utc_decode[type].source);
image_util_decode_destroy(utc_decode[type].handle);
utc_decode[type].handle = NULL;
{
image_util_type_e type = 0;
- for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
+ for (type = 0; type <= UTC_IMAGE_TYPE_N; type++) {
IMAGEUTIL_SAFE_G_FREE(utc_encode[type].result.buffer);
utc_encode[type].result.size = 0;
utc_encode[type].result.buffer_size = 0;
int utc_image_util_decode_run2_n(void)
{
int ret = IMAGE_UTIL_ERROR_NONE;
- image_util_image_h decoded_image = NULL;
image_util_type_e type = 0;
for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
- ret = image_util_decode_run2(utc_decode[type].handle, &decoded_image);
- assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
-
ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
utc_encode[type].output = _utc_get_test_path(pszValue, UTC_CONFIG[type].output);
- FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type, utc_encode[type].output);
+ FPRINTF("[%d:%s] PATH [Type: %d] [Encode: %s] \\n", __LINE__, __FUNCTION__, type, utc_encode[type].output);
if (!utc_encode[type].output)
FPRINTF("[%d:%s] Get UTC Path error! \\n", __LINE__, __FUNCTION__);