aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormutantturkey <mutantturke@gmail.com>2012-07-16 17:39:50 -0400
committermutantturkey <mutantturke@gmail.com>2012-07-16 17:39:50 -0400
commit5b9e1f7295306931b4cb90df059ab9c2c08650cf (patch)
tree1869d8309c3d55c01466f627d005bb7e703c4391
parent181b9070fef88c1d946a53b9db6344cd5b2b0114 (diff)
fixed iterator bug
-rw-r--r--fly-tools/background/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fly-tools/background/main.c b/fly-tools/background/main.c
index e27ff2b..bca80c2 100644
--- a/fly-tools/background/main.c
+++ b/fly-tools/background/main.c
@@ -27,7 +27,7 @@ int findmax (uint8_t *p, int n) {
int main(int argc, char **argv ) {
- char *usage = "derive-background -i <input-list> -s <sample-file> -o <output-filename>";
+ char *usage = "derive-background -i <input-list> -o <output-filename>";
char *output_file = NULL;
char *image_list = NULL;
int c;
@@ -90,8 +90,12 @@ int main(int argc, char **argv ) {
}
int height = MagickGetImageHeight(first_wand);
- int width = MagickGetImageWidth(first_wand);
+ int width = MagickGetImageWidth(first_wand);
+ if (height == 0 | width == 0) {
+ puts("height/or width is 0!");
+ exit(1);
+ }
first_wand = DestroyMagickWand(first_wand);
printf("height: %d width:%d \n", height, width);
@@ -135,7 +139,7 @@ int main(int argc, char **argv ) {
printf("Image number:%d Filename: %s \n", image, filename);
for (i=0; i<height; i++) {
- pixels = PixelGetNextIteratorRow(input_iterator, &width);
+ pixels = PixelGetNextIteratorRow(input_iterator, &j);
for (j=0; j<width ; j++) {
green = PixelGetGreen(pixels[j]);