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, "
return NULL;
}
- /* \postconditions */
- assert( image_read->numcomps == 1 || image_read->numcomps == 3 );
return image_read;
}
/* 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;
printf("<DartMeasurement name=\"NumberOfPixelsWithDifferences_%d\" type=\"numeric/int\"> %d </DartMeasurement> \n", it_comp, nbPixelDiff);
printf("<DartMeasurement name=\"ComponentError_%d\" type=\"numeric/double\"> %f </DartMeasurement> \n", it_comp, sumDiff);
+ printf("<DartMeasurement name=\"PEAK_%d\" type=\"numeric/double\"> %f </DartMeasurement> \n", it_comp, PEAK);
+ printf("<DartMeasurement name=\"MSE_%d\" type=\"numeric/double\"> %f </DartMeasurement> \n", it_comp, MSE);
#ifdef OPJ_HAVE_LIBPNG
{