diff --git a/src/bin/inspect.c b/src/bin/inspect.c index 6067a3c..cf3dc64 100644 --- a/src/bin/inspect.c +++ b/src/bin/inspect.c @@ -1505,6 +1505,7 @@ main(int argc, char *argv[]) { const char *out_ext = strrchr(output, '.'); Exactness_Unit *unit1 = NULL, *unit2 = NULL, *unitO = NULL; + int nb_diffs = 0; Eina_List *itr1, *itr2; EINA_LIST_FOREACH(_units, itr1, unit) { @@ -1534,8 +1535,10 @@ main(int argc, char *argv[]) Exactness_Image *ex_img1 = itr1 ? eina_list_data_get(itr1) : NULL; Exactness_Image *ex_img2 = itr2 ? eina_list_data_get(itr2) : NULL; Exactness_Image *ex_imgO = NULL; - if (exactness_image_compare(ex_img1, ex_img2, &ex_imgO)) + Eina_Bool has_diff = exactness_image_compare(ex_img1, ex_img2, &ex_imgO); + if (has_diff || !strcmp(out_ext, ".exu")) { + if (has_diff) nb_diffs++; if (!unitO) unitO = calloc(1, sizeof(*unitO)); unitO->imgs = eina_list_append(unitO->imgs, ex_imgO); unitO->nb_shots++; @@ -1564,7 +1567,7 @@ main(int argc, char *argv[]) else if (!strcmp(out_ext, ".exu")) { _diff_result_print(unit1, unit2); - if (unitO) exactness_unit_file_write(unitO, output); + if (nb_diffs) exactness_unit_file_write(unitO, output); else ret = 0; } else