aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2014-11-07 01:55:15 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2014-11-07 01:55:15 +0100
commit24874acb82671fa17d5988cd6cb6af89ba31e2e3 (patch)
treefbc5e185598ec5b8bdb44aafb0587aa9df9ab326
parentdee91d82004ed7dfe217b12fe8d49d7ae508ac5b (diff)
downloadyawa-24874acb82671fa17d5988cd6cb6af89ba31e2e3.tar.xz
yawa.c: Exit with -2 on bad colors
-rw-r--r--src/yawa.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/yawa.c b/src/yawa.c
index 71e6931..45749a0 100644
--- a/src/yawa.c
+++ b/src/yawa.c
@@ -383,7 +383,7 @@ main (int argc, char **argv)
if (parse_color(arguments.color, &c, alpha) == 0)
{
fprintf(stderr, "Bad color (%s)\n", arguments.color);
- continue;
+ exit(-2);
}
imlib_context_set_color(c.r, c.g, c.b, c.a);
imlib_image_fill_rectangle(0, 0, width, height);
@@ -402,7 +402,7 @@ main (int argc, char **argv)
if (parse_color(arguments.add_color[i], &c, alpha) == 0)
{
fprintf(stderr, "Bad color (%s)\n", arguments.add_color[i]);
- continue;
+ exit(-2);
}
imlib_context_set_color(c.r, c.g, c.b, c.a);
imlib_add_color_to_color_range(1);
@@ -444,6 +444,7 @@ main (int argc, char **argv)
continue;
}
}
+
if (arguments.tint)
{
Color c;
@@ -453,7 +454,7 @@ main (int argc, char **argv)
if (parse_color(arguments.color, &c, 255) == 0)
{
fprintf(stderr, "Bad color\n");
- continue;
+ exit(-2);
}
imlib_get_color_modifier_tables(r, g, b, a);
@@ -537,6 +538,7 @@ main (int argc, char **argv)
}
imlib_modify_color_modifier_gamma(dblval);
}
+
if (arguments.flipv)
{
imlib_image_flip_vertical();
@@ -549,6 +551,7 @@ main (int argc, char **argv)
{
imlib_image_flip_diagonal();
}
+
if (arguments.write)
{
imlib_save_image(argv[i]);