diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2020-06-02 16:29:32 -0700 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2020-06-26 10:18:28 -0700 |
commit | 135f2ceaa84fb0a058ba781a451c65b95230e49a (patch) | |
tree | 5558066a2535fa2d645b26d503bb9519399153e0 /toolbin | |
parent | c022554c30f680c464f1026dc96c2450867da73c (diff) | |
download | ghostpdl-135f2ceaa84fb0a058ba781a451c65b95230e49a.tar.gz |
Have bmpcmp return EXIT_FAILURE if it can not compare
Diffstat (limited to 'toolbin')
-rw-r--r-- | toolbin/bmpcmp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/toolbin/bmpcmp.c b/toolbin/bmpcmp.c index 239f3a967..78b7ef7be 100644 --- a/toolbin/bmpcmp.c +++ b/toolbin/bmpcmp.c @@ -3688,6 +3688,7 @@ int main(int argc, char *argv[]) DiffFn *diffFn; Params params; int noDifferences = 1; + int can_compare = 1; void *lab1, *lab2; parseArgs(argc, argv, ¶ms); @@ -3723,11 +3724,13 @@ int main(int argc, char *argv[]) "bmpcmp: Page %d: Can't compare images " "(w=%d,%d) (h=%d,%d) (s=%d,%d) (bpp=%d,%d) (cmyk=%d,%d)!\n", imagecount, w, w2, h, h2, s, s2, bpp, bpp2, cmyk, cmyk2); + can_compare = 0; continue; } if (params.lab && (lab1 == NULL || lab2 == NULL)) { fprintf(stderr, "bmpcmp: Lab compare failed (only valid for tiffs with icc profiles)\n"); + can_compare = 0; continue; } @@ -3925,12 +3928,15 @@ done: imagecount+1, params.filename2); exit(EXIT_FAILURE); } + /* Also count as a failure if the images are different sizes, color, bits etc */ + if (can_compare == 0) + exit(EXIT_FAILURE); image_close(&image1); image_close(&image2); if (noDifferences == 1) - fprintf(stderr, "bmpcmp: no differences detected\n"); + fprintf(stderr, "bmpcmp: no differences detected\n"); return EXIT_SUCCESS; } |