X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fcompare_images.c;h=b2ef00db73b2b1cbe8105c1d8efe4d8110ee5d5e;hb=9c1cfb034a8cf24eb5e35fe9c7074fd079d14b80;hp=38c36f51ff1ec884d84efcda0b0cb01359f67d48;hpb=b7ebf54a29a9275939bf86b7548f547a8bac3614;p=openjpeg.git diff --git a/tests/compare_images.c b/tests/compare_images.c index 38c36f51..b2ef00db 100644 --- a/tests/compare_images.c +++ b/tests/compare_images.c @@ -85,7 +85,7 @@ static void compare_images_help_display(void) fprintf(stdout,"\n"); fprintf(stdout," -b \t REQUIRED \t filename to the reference/baseline PGX/TIF/PNM image \n"); fprintf(stdout," -t \t REQUIRED \t filename to the test PGX/TIF/PNM image\n"); - fprintf(stdout," -n \t REQUIRED \t number of component of the image (used to generate correct filename)\n"); + fprintf(stdout," -n \t REQUIRED \t number of component of the image (used to generate correct filename, not used when both input files are TIF)\n"); fprintf(stdout," -m \t OPTIONAL \t list of MSE tolerances, separated by : (size must correspond to the number of component) of \n"); fprintf(stdout," -p \t OPTIONAL \t list of PEAK tolerances, separated by : (size must correspond to the number of component) \n"); fprintf(stdout," -s \t OPTIONAL \t 1 or 2 filename separator to take into account PGX/PNM image with different components, " @@ -279,8 +279,6 @@ static opj_image_t* readImageFromFileTIF(const char* filename, int nbFilenamePGX return NULL; } - /* \postconditions */ - assert( image_read->numcomps == 1 || image_read->numcomps == 3 ); return image_read; } @@ -771,6 +769,13 @@ int main(int argc, char **argv) /* Comparison of header parameters*/ printf("Step 1 -> Header comparison\n"); + /* check dimensions (issue 286)*/ + if(imageBase->numcomps != imageTest->numcomps ) + { + printf("ERROR: dim mismatch (%d><%d)\n", imageBase->numcomps, imageTest->numcomps); + goto cleanup; + } + for (it_comp = 0; it_comp < imageBase->numcomps; it_comp++) { param_image_diff[it_comp].x0 = 0; @@ -872,6 +877,8 @@ int main(int argc, char **argv) printf(" %d \n", it_comp, nbPixelDiff); printf(" %f \n", it_comp, sumDiff); + printf(" %f \n", it_comp, PEAK); + printf(" %f \n", it_comp, MSE); #ifdef OPJ_HAVE_LIBPNG {