aboutsummaryrefslogtreecommitdiffstats
path: root/src/blind-find-rectangle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/blind-find-rectangle.c')
-rw-r--r--src/blind-find-rectangle.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/blind-find-rectangle.c b/src/blind-find-rectangle.c
index ac6e843..54cf2cc 100644
--- a/src/blind-find-rectangle.c
+++ b/src/blind-find-rectangle.c
@@ -111,18 +111,23 @@ main(int argc, char *argv[])
cache = emalloc2(stream.width + 1, sizeof(*cache));
buf = emalloc(stream.row_size);
+ if (argc > 3)
+ CHECK_ALPHA(&stream);
+ CHECK_N_CHAN(&stream, 1, 3 + !!stream.alpha);
if (stream.encoding == DOUBLE) {
colour_lf[0] = X;
colour_lf[1] = Y;
colour_lf[2] = Z;
colour_lf[3] = alpha;
process(colour_lf);
- } else {
+ } else if (stream.encoding == FLOAT) {
colour_f[0] = (float)X;
colour_f[1] = (float)Y;
colour_f[2] = (float)Z;
colour_f[3] = (float)alpha;
process(colour_f);
+ } else {
+ eprintf("pixel format %s is not supported, try xyza\n", stream.pixfmt);
}
fshut(stdout, "<stdout>");