#include <string.h>
#include <errno.h>
#include <glib.h>
-#include <limits.h>
#include <mm_util_anim.h>
#include <mm_util_image.h>
static unsigned int g_height = 0;
/* for reading file */
-static void *g_readed_data = NULL;
-static size_t g_readed_size = 0;
+static void *g_read_data = NULL;
+static size_t g_read_size = 0;
static mm_util_image_h g_decoded_data = NULL;
}
SAFE_FREE(data);
} else if (mode == TEST_DECODE_MEMORY) {
- ret = mm_util_file_read(g_path, &g_readed_data, &g_readed_size);
+ ret = mm_util_file_read(g_path, &g_read_data, &g_read_size);
if (ret != MM_UTIL_ERROR_NONE) {
fprintf(stderr, "\t[GIF_testsuite] mm_util_file_read failed %d\n", ret);
return FALSE;
}
- ret = mm_util_decode_from_gif_memory(g_readed_data, g_readed_size, &g_decoded_data);
+ ret = mm_util_decode_from_gif_memory(g_read_data, g_read_size, &g_decoded_data);
if (ret != MM_UTIL_ERROR_NONE) {
fprintf(stderr, "\t[GIF_testsuite] mm_util_decode_from_gif_memory failed %d\n", ret);
return FALSE;
if ((mode != TEST_ENCODE_FILE) && (mode != TEST_ENCODE_MEMORY))
return TRUE;
- ret = mm_util_file_read(g_path, &g_readed_data, &g_readed_size);
+ ret = mm_util_file_read(g_path, &g_read_data, &g_read_size);
if (ret != MM_UTIL_ERROR_NONE) {
fprintf(stderr, "\t[GIF_testsuite] mm_util_file_read failed %d\n", ret);
return FALSE;
}
- ret = mm_image_create_image(g_width, g_height, MM_UTIL_COLOR_RGBA, (unsigned char *)g_readed_data, g_readed_size, &g_decoded_data);
+ ret = mm_image_create_image(g_width, g_height, MM_UTIL_COLOR_RGBA, (unsigned char *)g_read_data, g_read_size, &g_decoded_data);
if (ret != MM_UTIL_ERROR_NONE) {
fprintf(stderr, "\t[GIF_testsuite] mm_image_create_image failed : %d\n", ret);
return FALSE;
fprintf(stderr, "\t[GIF_testsuite] >>>>>>>>>>>>>>>>>>>>>> \'%s\' TEST SUCCESS\n", MODE_TO_STR[test_mode]);
- g_free(g_readed_data);
- g_readed_data = NULL;
+ g_free(g_read_data);
+ g_read_data = NULL;
SAFE_IMAGE_FREE(g_decoded_data);
test_mode++;
}
out:
g_free(g_path);
- g_free(g_readed_data);
+ g_free(g_read_data);
SAFE_IMAGE_FREE(g_decoded_data);
return 0;
static int g_color = MM_UTIL_COLOR_RGB24;
/* for reading file */
-static void *g_readed_data = NULL;
-static gsize g_readed_size = 0;
+static void *g_read_data = NULL;
+static gsize g_read_size = 0;
/* for saving result */
static const char *g_test_filename[TEST_NUM][MM_UTIL_COLOR_NUM] = {
return FALSE;
}
} else if (mode == TEST_DECODE_BUFFER) {
- ret = mm_util_file_read(g_path, &g_readed_data, &g_readed_size);
+ ret = mm_util_file_read(g_path, &g_read_data, &g_read_size);
if (ret != MM_UTIL_ERROR_NONE) {
g_print("\t[HEIF_testsuite] mm_util_file_read failed %d\n", ret);
return FALSE;
}
- ret = mm_util_decode_heif_from_buffer(g_readed_data, g_readed_size, color, &g_decoded_data);
+ ret = mm_util_decode_heif_from_buffer(g_read_data, g_read_size, color, &g_decoded_data);
if (ret != MM_UTIL_ERROR_NONE) {
g_print("\t[HEIF_testsuite] mm_util_decode_heif_from_buffer failed %d\n", ret);
return FALSE;
if ((test_mode == TEST_DECODE_FILE) || (test_mode == TEST_DECODE_BUFFER)) {
for (color = MM_UTIL_COLOR_YUV420; color < MM_UTIL_COLOR_NUM; color++) {
result |= __test_decode(test_mode, color, g_test_filename[test_mode][color]);
- SAFE_FREE(g_readed_data);
+ SAFE_FREE(g_read_data);
SAFE_IMAGE_FREE(g_decoded_data);
}
}
out:
g_free(g_path);
- SAFE_FREE(g_readed_data);
+ SAFE_FREE(g_read_data);
SAFE_IMAGE_FREE(g_decoded_data);
return 0;
static int g_downscale = MM_UTIL_JPEG_DECODE_DOWNSCALE_1_1;
/* for reading file */
-static void *g_readed_data = NULL;
-static size_t g_readed_size = 0;
+static void *g_read_data = NULL;
+static size_t g_read_size = 0;
static mm_util_image_h g_decoded_data = NULL;
}
SAFE_FREE(data);
} else if (mode == TEST_DECODE_MEMORY) {
- ret = mm_util_file_read(g_path, &g_readed_data, &g_readed_size);
+ ret = mm_util_file_read(g_path, &g_read_data, &g_read_size);
if (ret != MM_UTIL_ERROR_NONE) {
fprintf(stderr, "\t[JPEG_testsuite] mm_util_file_read failed %d\n", ret);
return FALSE;
}
- ret = mm_util_decode_from_jpeg_memory(g_readed_data, g_readed_size, g_color, g_downscale, &g_decoded_data);
+ ret = mm_util_decode_from_jpeg_memory(g_read_data, g_read_size, g_color, g_downscale, &g_decoded_data);
if (ret != MM_UTIL_ERROR_NONE) {
fprintf(stderr, "\t[JPEG_testsuite] mm_util_decode_from_jpeg_memory failed %d\n", ret);
return FALSE;
if ((mode != TEST_ENCODE_FILE) && (mode != TEST_ENCODE_MEMORY))
return TRUE;
- ret = mm_util_file_read(g_path, &g_readed_data, &g_readed_size);
+ ret = mm_util_file_read(g_path, &g_read_data, &g_read_size);
if (ret != MM_UTIL_ERROR_NONE) {
fprintf(stderr, "\t[JPEG_testsuite] mm_util_file_read failed %d\n", ret);
return FALSE;
}
- ret = mm_image_create_image(g_width, g_height, g_color, (unsigned char *)g_readed_data,
- g_readed_size, &g_decoded_data);
+ ret = mm_image_create_image(g_width, g_height, g_color, (unsigned char *)g_read_data,
+ g_read_size, &g_decoded_data);
if (ret != MM_UTIL_ERROR_NONE) {
fprintf(stderr, "\t[JPEG_testsuite] mm_image_create_image failed : %d\n", ret);
return FALSE;
fprintf(stderr, "\t[JPEG_testsuite] >>>>>>>>>>>>>>>>>>>>>> \'%s\' TEST SUCCESS\n", MODE_TO_STR[test_mode]);
- SAFE_FREE(g_readed_data);
+ SAFE_FREE(g_read_data);
SAFE_IMAGE_FREE(g_decoded_data);
test_mode++;
}
out:
g_free(g_path);
- SAFE_FREE(g_readed_data);
+ SAFE_FREE(g_read_data);
SAFE_IMAGE_FREE(g_decoded_data);
return 0;
static bool g_lossless = false;
/* for reading file */
-static void *g_readed_data = NULL;
-static gsize g_readed_size = 0;
+static void *g_read_data = NULL;
+static gsize g_read_size = 0;
/* for saving result */
static const char *g_test_filename[TEST_NUM][MM_UTIL_COLOR_NUM] = {
{
int ret = 0;
- ret = mm_util_file_read(g_path, &g_readed_data, &g_readed_size);
+ ret = mm_util_file_read(g_path, &g_read_data, &g_read_size);
if (ret != MM_UTIL_ERROR_NONE) {
g_print("\t[JXL_testsuite] mm_util_file_read failed : %d\n", ret);
return FALSE;
}
ret = mm_image_create_image(g_width, g_height, g_color,
- (const unsigned char*)g_readed_data, g_readed_size, &g_decoded_data);
+ (const unsigned char*)g_read_data, g_read_size, &g_decoded_data);
if (ret != MM_UTIL_ERROR_NONE) {
g_print("\t[JXL_testsuite] mm_image_create_image failed : %d\n", ret);
return FALSE;
{
int ret = 0;
- SAFE_FREE(g_readed_data);
+ SAFE_FREE(g_read_data);
SAFE_IMAGE_FREE(g_decoded_data);
if ((mode != TEST_DECODE_FILE) && (mode != TEST_DECODE_BUFFER))
return FALSE;
}
} else if (mode == TEST_DECODE_BUFFER) {
- ret = mm_util_file_read(g_path, &g_readed_data, &g_readed_size);
+ ret = mm_util_file_read(g_path, &g_read_data, &g_read_size);
if (ret != MM_UTIL_ERROR_NONE) {
g_print("\t[JXL_testsuite] mm_util_file_read failed : %d\n", ret);
return FALSE;
}
- ret = mm_util_decode_jxl_from_buffer(g_readed_data, g_readed_size, color, &g_decoded_data);
+ ret = mm_util_decode_jxl_from_buffer(g_read_data, g_read_size, color, &g_decoded_data);
if (ret != MM_UTIL_ERROR_NONE) {
g_print("\t[JXL_testsuite] mm_util_decode_jxl_from_buffer failed %d\n", ret);
return FALSE;
out:
g_free(g_path);
- SAFE_FREE(g_readed_data);
+ SAFE_FREE(g_read_data);
SAFE_IMAGE_FREE(g_decoded_data);
mm_util_enc_opt_destroy(g_enc_opt);
#include <string.h>
#include <errno.h>
#include <glib.h>
-#include <limits.h>
#include <mm_util_image.h>
#include <mm_util_magick.h>