Skip to content

Commit

Permalink
Fixes #342, #343, #344.
Browse files Browse the repository at this point in the history
Some command-line options for the jasper, imginfo, imgcmp, and jiv
programs (that are not deemed to be for internal use only) were not
documented in the manual.  Descriptions for these options have now been
added to the manual.

The help information message printed by each of the jasper, imginfo,
imgcmp, and jiv programs has been improved.  A mention of the URL for the
online documentation is now included in all help messages.  A comment
has also been added indicating that not all options are listed in the
help message and that the manual should be checked for a complete list
of options (excluding, of course, the ones that are deemed to be for
internal use only and are deliberately undocumented).
  • Loading branch information
mdadams committed Nov 4, 2022
1 parent 34faad5 commit e97639f
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 21 deletions.
15 changes: 15 additions & 0 deletions doc/src/apps_imgcmp.dox
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ components, component subsampling factors, etc.).

The following options are supported:

- `--help`
- Print help information and exit.

- `--version`
- Display the version information and exit.

- `--verbose`
- Increase the verbosity level.

- `-f $file`
- Read the primary (i.e., reference) image (for comparison purposes)
from the file named `$file`.
Expand All @@ -37,6 +46,12 @@ The following options are supported:
- `mae`: mean absolute error (MAE)
- `equal`: equality

- `--memory-limit $n`
- Set the memory limit to `$n` bytes.

- `--debug-level $level`
- Set the debug level to `$level`.

The `-f` and `-F` options must always be specified.
There is currently no way to explicitly specify the format of the images.
If the format of either image cannot be autodetected, the command will
Expand Down
12 changes: 12 additions & 0 deletions doc/src/apps_jiv.dox
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,20 @@ The following options are supported:
- `--help`
- Print help information and exit.

- `--version`
- Display the version information and exit.

- `--wait $n`
- Automatically step from one image to the next,
pausing for `$n` seconds in between.

- `--loop`
- Repeatedly cycle through the specified images.

- `--memory-limit $n`
- Set the memory limit to `$n` bytes.

- `--debug-level $level`
- Set the debug level to `$level`.

*/
22 changes: 16 additions & 6 deletions src/app/imgcmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,14 +694,24 @@ void cmdinfo()

void usage()
{
static const char helpinfo[] = {
"Some of the supported options include:\n"
" -f $file\n"
" Set the pathname of reference image file to $file.\n"
" -F $other_image_file\n"
" Set pathname of the other image file to $file.\n"
" -m $metric\n"
" Set the metric to $metric.\n"
"For additional information, please see the online documentation.\n"
};
cmdinfo();
fprintf(stderr, "usage:\n");
fprintf(stderr,"%s ", cmdname);
fprintf(stderr, "\n");
fprintf(stderr, "%s\n", JAS_NOTES);
fprintf(stderr, "usage: %s [options]\n", cmdname);
fprintf(stderr, "\n");
fprintf(stderr, "%s\n", helpinfo);
fprintf(stderr,
"-f reference_image_file -F other_image_file [-m metric]\n"
);
fprintf(stderr,
"The metric argument may assume one of the following values:\n"
"The metric specifier may assume one of the following values:\n"
" psnr .... peak signal to noise ratio\n"
" mse ..... mean squared error\n"
" rmse .... root mean squared error\n"
Expand Down
19 changes: 12 additions & 7 deletions src/app/imginfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,16 @@ static void cmdinfo()
static void usage()
{
static const char help[] = {
"Options:\n"
"Some supported options include:\n"
" --help\n"
" --version\n"
" Display the version information and exit.\n"
" --verbose\n"
" Increase the verbosity level.\n"
" -f $file\n"
" Read the input image from the file $file.\n"
" --list-enabled-formats\n"
" Print the names of all of the enabled image formats.\n"
" --memory-limit $n\n"
" Set the memory limit to $n bytes.\n"
" --debug-level $level\n"
Expand All @@ -392,14 +400,11 @@ static void usage()
" Set the maximum number of samples for decoding to $n\n"
" --decoder-option $string\n"
" Add the option $string to the list of decoder options.\n"
" --verbose\n"
" Increase the verbosity level.\n"
" --version\n"
" Display the version information and exit.\n"
" -f $file\n"
" Read the input image from the file $file.\n"
"For additional information, please see the online documentation.\n"
};
cmdinfo();
fprintf(stderr, "\n");
fprintf(stderr, "%s\n", JAS_NOTES);
fprintf(stderr, "usage:\n");
fprintf(stderr,"%s ", cmdname);
fprintf(stderr, "[-f image_file]\n");
Expand Down
7 changes: 3 additions & 4 deletions src/app/jasper.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ void cmdinfo()
}

static const char *const helpinfo[] = {
"The following options are supported:\n",
"Some of the supported options include:\n",
" --help Print this help information and exit.\n",
" --version Print version information and exit.\n",
" --verbose Enable verbose mode.\n",
Expand All @@ -608,9 +608,7 @@ static const char *const helpinfo[] = {
" (See below for the list of supported formats.)\n",
" --output-option $opt Provide the option $opt to the encoder.\n",
" --force-srgb Force conversion to the sRGB color space.\n",
"Some of the above option names can be abbreviated as follows:\n",
" --input = -f, --input-format = -t, --input-option = -o,\n",
" --output = -F, --output-format = -T, --output-option = -O\n",
"For additional information, please see the online documentation.\n",
0
};

Expand All @@ -623,6 +621,7 @@ void cmdusage()
for (i = 0, s = helpinfo[i]; s; ++i, s = helpinfo[i]) {
fprintf(stderr, "%s", s);
}
fprintf(stderr, "\n");

fprintf(stderr, "The following formats are supported:\n");
int fmtind;
Expand Down
4 changes: 3 additions & 1 deletion src/app/jiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,17 @@ static void cmdinfo()
JAS_VERSION);
fprintf(stderr, "Copyright (c) 2002-2003 Michael David Adams.\n"
"All rights reserved.\n");
fprintf(stderr, "\n");
fprintf(stderr, "%s\n", JAS_NOTES);
}

static const char *const helpinfo[] = {
"The following options are supported:\n",
"Some of the supported options include:\n",
" --help Print this help information and exit.\n",
" --version Print version information and exit.\n",
" --loop Loop indefinitely through images.\n",
" --wait N Advance to next image after N seconds.\n",
"For additional information, please see the online documentation.\n",
0
};

Expand Down
6 changes: 3 additions & 3 deletions src/libjasper/include/jasper/jas_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ extern "C" {
"All rights reserved.\n"

#define JAS_NOTES \
"For more information about this software, please visit the following\n" \
"web sites/pages:\n" \
"For information about the JasPer project, see:\n" \
" https://jasper-software.github.io/jasper\n" \
" https://jasper-software.github.io/jasper-manual\n" \
" https://www.ece.uvic.ca/~mdadams/jasper\n" \
"For online documentation on the JasPer software, see:\n" \
" https://jasper-software.github.io/jasper-manual\n" \
"Please submit bug reports using the bug-tracker at:\n" \
" https://github.com/jasper-software/jasper/issues\n"

Expand Down

0 comments on commit e97639f

Please sign in to comment.