From 26606c71c8a5c3a79f9e371e1c0ddfcb800b77df Mon Sep 17 00:00:00 2001 From: Francois-Olivier Devaux Date: Mon, 10 Dec 2007 13:16:01 +0000 Subject: First import of JAVAOpenJPEG, a Java wrapper of OpenJPEG, developed by Patrick Piscaglia of Telemis (www.telemis.com). Thank you Patrick for this new module ! --- codec/compat/getopt.c | 8 ++++++-- codec/image_to_j2k.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'codec') diff --git a/codec/compat/getopt.c b/codec/compat/getopt.c index 23270e6a..f434924b 100644 --- a/codec/compat/getopt.c +++ b/codec/compat/getopt.c @@ -59,7 +59,11 @@ typedef struct option #define BADARG (int)':' #define EMSG "" - +/* As this class remembers its values from one Java call to the other, reset the values before each use */ +void reset_options_reading() { + opterr = 1; + optind = 1; +} /* * getopt -- @@ -132,7 +136,7 @@ struct option *longopts, int totlen) { char param = 1; again: - if (optind>argc || !argv[optind] || *argv[optind]!='-') + if (optind >= argc || !argv[optind] || *argv[optind]!='-') return -1; if (argv[optind][0]=='-' && argv[optind][1]==0) { diff --git a/codec/image_to_j2k.c b/codec/image_to_j2k.c index f505e997..7fbd5a8a 100644 --- a/codec/image_to_j2k.c +++ b/codec/image_to_j2k.c @@ -1692,7 +1692,7 @@ int main(int argc, char **argv) { if (*indexfilename) { bSuccess = write_index_file(&cstr_info, indexfilename); if (bSuccess) { - fprintf(stderr, "Failed to output index file\n"); + fprintf(stderr, "Failed to output index file into [%s]\n", indexfilename); } } -- cgit v1.2.3