Echo Kakadu copyright notice
[openjpeg.git] / tests / compare_images.c
index f0dc5e82533d64681698f9bca2ffe64cd13c6de9..cb1b1301147bc6a0c13703b950c430644947e0fd 100644 (file)
@@ -196,7 +196,7 @@ static opj_image_t* readImageFromFilePPM(const char* filename, int nbFilenamePGX
     if (!image_read)
       {
       int it_free_data;
-      fprintf(stderr, "Unable to load pgx file\n");
+      fprintf(stderr, "Unable to load ppm file: %s\n", filenameComponentPGX);
 
       free(param_image_read);
 
@@ -771,6 +771,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;