projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r61: Added support for new SGP library
[ctsim.git]
/
src
/
sdf-2.c
diff --git
a/src/sdf-2.c
b/src/sdf-2.c
index 29ccc34ac570c665c5d59d0060231f5249991434..57a8469f739cf2fb0b6429f279b0dadc240cb82b 100644
(file)
--- a/
src/sdf-2.c
+++ b/
src/sdf-2.c
@@
-2,8
+2,11
@@
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: sdf-2.c,v 1.
4 2000/05/16 04:33:59
kevin Exp $
+** $Id: sdf-2.c,v 1.
5 2000/05/24 22:50:04
kevin Exp $
** $Log: sdf-2.c,v $
** $Log: sdf-2.c,v $
+** Revision 1.5 2000/05/24 22:50:04 kevin
+** Added support for new SGP library
+**
** Revision 1.4 2000/05/16 04:33:59 kevin
** Improved option processing
**
** Revision 1.4 2000/05/16 04:33:59 kevin
** Improved option processing
**
@@
-138,11
+141,21
@@
sdf2_main (int argc, char *const argv[])
im_in1 = image_load (in_file1);
im_in2 = image_load (in_file2);
im_in1 = image_load (in_file1);
im_in2 = image_load (in_file2);
+ if (im_in1 == NULL || im_in2 == NULL) {
+ fprintf(stderr, "Error reading an image");
+ return (1);
+ }
+
if (im_in1->nx != im_in2->nx || im_in1->ny != im_in2->ny) {
if (im_in1->nx != im_in2->nx || im_in1->ny != im_in2->ny) {
- fprintf(stderr, "Size of image 1 (%d,%d) and image 2 (%d,%d) do not match\n",
+ fprintf(stderr, "
Error:
Size of image 1 (%d,%d) and image 2 (%d,%d) do not match\n",
im_in1->nx, im_in1->ny, im_in2->nx, im_in2->ny);
im_in1->nx, im_in1->ny, im_in2->nx, im_in2->ny);
- exit(1);
+ return(1);
+ }
+ if (im_in1->nx < 0 || im_in1->ny < 0) {
+ fprintf(stderr, "Error: Size of image < 0");
+ return(1);
}
}
+
im_out = image_create (out_file, im_in1->nx, im_in1->ny);
if (opt_add) {
im_out = image_create (out_file, im_in1->nx, im_in1->ny);
if (opt_add) {