summaryrefslogtreecommitdiff
path: root/tools/tiffmedian.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/tiffmedian.c')
-rw-r--r--tools/tiffmedian.c41
1 files changed, 28 insertions, 13 deletions
diff --git a/tools/tiffmedian.c b/tools/tiffmedian.c
index 6654cd6f..f8b529ec 100644
--- a/tools/tiffmedian.c
+++ b/tools/tiffmedian.c
@@ -61,6 +61,10 @@
#define EXIT_FAILURE 1
#endif
+#ifndef HAVE_GETOPT
+extern int getopt(int argc, char * const argv[], const char *optstring);
+#endif
+
#define MAX_CMAP_SIZE 256
#define streq(a,b) (strcmp(a,b) == 0)
@@ -325,20 +329,31 @@ processCompressOptions(char* opt)
return (1);
}
-char* stuff[] = {
+char* usage_info[] = {
"usage: tiffmedian [options] input.tif output.tif",
"where options are:",
-" -r # make each strip have no more than # rows",
-" -C # create a colormap with # entries",
-" -f use Floyd-Steinberg dithering",
-" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts] compress output with deflate encoding",
-" -c packbits compress output with packbits encoding",
-" -c none use no compression algorithm on output",
+" -r # make each strip have no more than # rows",
+" -C # create a colormap with # entries",
+" -f use Floyd-Steinberg dithering",
+"",
+#ifdef LZW_SUPPORT
+" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
+/* " LZW options:", */
+" # set predictor value",
+" For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
+#endif
+#ifdef ZIP_SUPPORT
+" -c zip[:opts] compress output with deflate encoding",
+/* " Deflate (ZIP) options:", */
+" # set predictor value",
+#endif
+#ifdef PACKBITS_SUPPORT
+" -c packbits compress output with packbits encoding",
+#endif
+#if defined(LZW_SUPPORT) || defined(ZIP_SUPPORT) || defined(PACKBITS_SUPPORT)
+" -c none use no compression algorithm on output",
+#endif
"",
-"LZW and deflate options:",
-" # set predictor value",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
NULL
};
@@ -349,8 +364,8 @@ usage(int code)
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ for (i = 0; usage_info[i] != NULL; i++)
+ fprintf(out, "%s\n", usage_info[i]);
exit(code);
}