blob: e0f31db0b356aca21f33c2f193b68dc9519e9269 [file] [log] [blame]
Here is an alternate command-line user interface for the IJG JPEG software.
It is designed for use under MS-DOS, and may also be useful on other non-Unix
operating systems. (For that matter, this code works fine on Unix, but the
standard command-line syntax is better on Unix because it is pipe-friendly.)
With this user interface, cjpeg and djpeg accept multiple input file names
on the command line; output file names are generated by substituting
appropriate extensions. The user is prompted before any already-existing
file will be overwritten. See usage.alt for details.
Expansion of wild-card file specifications is useful but is not directly
provided by this code. Most DOS C compilers have the ability to do wild-card
expansion "behind the scenes", and we rely on that feature. On other systems,
the shell may do it for you, as is done on Unix.
Also, a DOS-specific routine is provided to determine available memory;
this makes the -maxmemory switch unnecessary except in unusual cases.
If you know how to determine available memory on a different system,
you can easily add the necessary code. (And please send it along to
jpeg-info@uunet.uu.net so we can include it in future releases!)
INSTALLATION
============
You need to have the main IJG JPEG distribution, release 6 or later.
Replace the standard cjpeg.c and djpeg.c files with the ones provided here.
Then build the software as described in the main distribution's install.doc
file, with these exceptions:
* Define PROGRESS_REPORT in jconfig.h if you want the percent-done display.
* Define NO_OVERWRITE_CHECK if you *don't* want overwrite confirmation.
* You may ignore the USE_SETMODE and TWO_FILE_COMMANDLINE symbols discussed
in install.doc; these files do not use them.
* As given, djpeg.c defaults to GIF output (not PPM output as in the standard
djpeg.c). If you want something different, modify DEFAULT_FMT.
You may also need to do something special to enable filename wild-card
expansion, assuming your compiler has that capability at all.
Modify the standard usage.doc file as described in usage.alt. (If you want
to use the Unix-style manual pages cjpeg.1 and djpeg.1, better fix them too.)
Here are some specific notes for popular MS-DOS compilers:
Borland C:
Add "-DMSDOS" to CFLAGS to enable use of the DOS memory determination code.
Link with the standard library file WILDARGS.OBJ to get wild-card expansion.
Microsoft C:
Add "-DMSDOS" to CFLAGS to enable use of the DOS memory determination code.
Link with the standard library file SETARGV.OBJ to get wild-card expansion.
In the versions I've used, you must also add /NOE to the linker switches to
avoid a duplicate-symbol error from including SETARGV.
DJGPP (we recommend version 2.0 or later):
Add "-DFREE_MEM_ESTIMATE=0" to CFLAGS. Wild-card expansion is automatic.
LEGAL ISSUES
============
This software is copyright (C) 1991-1998, Thomas G. Lane.
Terms of distribution and use are the same as for the free IJG JPEG software;
see its README file for details.
The authors make NO WARRANTY or representation, either express or implied,
with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.