From 92c8e54dc695afe1e3be1c2e022492016b12d8ba Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 14 Nov 2011 15:29:27 +0100 Subject: Check that geometry size matches image size --- src/indexamajig.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/indexamajig.c b/src/indexamajig.c index e7391bb5..7ce661aa 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -278,6 +278,20 @@ static void process_image(void *pp, int cookie) } hdf5_read(hdfile, &image, pargs->static_args.config_satcorr); + + if ( (image.width != image.det->max_fs+1) + || (image.height != image.det->max_ss+1) ) + { + ERROR("Image size doesn't match geometry size" + " - rejecting image.\n"); + ERROR("Image size: %i,%i. Geometry size: %i,%i\n", + image.width, image.height, + image.det->max_fs+1, image.det->max_ss+1); + hdfile_close(hdfile); + free_detector_geometry(image.det); + return; + } + if ( image.lambda < 0.0 ) { if ( beam != NULL ) { ERROR("Using nominal photon enery of %.2f eV\n", -- cgit v1.2.3