X-Git-Url: http://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/af13a143c8bfcd713216b1382448174e21b9f278..5057c6695cbe55f5d13e8e10a1e630c7ee00ea12:/src/lbximg.c diff --git a/src/lbximg.c b/src/lbximg.c index ada1692..c88fc4e 100644 --- a/src/lbximg.c +++ b/src/lbximg.c @@ -38,6 +38,10 @@ static int verbose = 0; static char *outname = "out"; static int usepalette = 1; +enum { + OPT_PREFIX = UCHAR_MAX+1, +}; + static void printusage(void) { puts("usage: lbximg [-i|-d] [-v] [-p palette_file] [-O override_file]" @@ -62,7 +66,9 @@ static const struct img_format { char name[4]; bool enabled; } formats[] = { +#if HAVE_LIBPNG { img_output_png, "png", 1 }, +#endif { img_output_pam, "pam", 1 }, { img_output_ppm, "ppm", 1 }, { img_output_pbm, "pbm", 1 }, @@ -330,19 +336,20 @@ int main(int argc, char **argv) static const char sopts[] = "idnvF:f:p:O:VH"; static const struct option lopts[] = { - { "ident", 0, NULL, 'i' }, - { "decode", 0, NULL, 'd' }, - { "verbose", 0, NULL, 'v' }, - { "file", 1, NULL, 'f' }, - { "format", 1, NULL, 'F' }, - { "palette", 1, NULL, 'p' }, - { "override", 1, NULL, 'p' }, + { "identify", 0, NULL, 'i' }, + { "decode", 0, NULL, 'd' }, + { "verbose", 0, NULL, 'v' }, + { "file", 1, NULL, 'f' }, + { "format", 1, NULL, 'F' }, + { "palette", 1, NULL, 'p' }, + { "override", 1, NULL, 'O' }, + { "no-palette", 0, NULL, 'n' }, - { "version", 0, NULL, 'V' }, - { "usage", 0, NULL, 'U' }, - { "help", 0, NULL, 'H' }, + { "output-prefix", 1, NULL, OPT_PREFIX }, - { "no-palette", 0, NULL, 'n' }, + { "version", 0, NULL, 'V' }, + { "usage", 0, NULL, 'U' }, + { "help", 0, NULL, 'H' }, { 0 } }; @@ -383,6 +390,9 @@ int main(int argc, char **argv) return EXIT_FAILURE; } break; + case OPT_PREFIX: + outname = optarg; + break; case 'V': tool_version(); return EXIT_SUCCESS; @@ -431,6 +441,9 @@ int main(int argc, char **argv) } switch (mode) { + case MODE_IDENT: + rc = 0; + break; case MODE_DECODE: rc = decode(img, palf, overf, fmt, &argv[optind]); break;