cdaltui.txt 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. IJG JPEG LIBRARY: ALTERNATE USER INTERFACE FOR CJPEG/DJPEG
  2. Copyright (C) 2020-2023, Guido Vollbeding.
  3. This file is part of the Independent JPEG Group's software.
  4. For conditions of distribution and use, see the accompanying README file.
  5. There is an alternate command-line user interface for the IJG JPEG software.
  6. It is designed for use under MS-DOS, and may also be useful on other non-Unix
  7. operating systems. (For that matter, this code works fine on Unix, but the
  8. standard command-line syntax is better on Unix because it is pipe-friendly.)
  9. With this user interface, cjpeg and djpeg accept multiple input file names
  10. on the command line; output file names are generated by substituting
  11. appropriate extensions. The user is prompted before any already-existing
  12. file will be overwritten.
  13. Expansion of wild-card file specifications is useful but is not directly
  14. provided by this code. Most DOS C compilers have the ability to do wild-card
  15. expansion "behind the scenes", and we rely on that feature. On other systems,
  16. the shell may do it for you, as is done on Unix.
  17. Also, a DOS-specific routine is provided to determine available memory;
  18. this makes the -maxmemory switch unnecessary except in unusual cases.
  19. If you know how to determine available memory on a different system,
  20. you can easily add the necessary code. (And please send it along
  21. to jpeg-info@ijg.org so we can include it in future releases!)
  22. INSTALLATION
  23. ============
  24. Rename the standard cjpeg.c file to cjpegstd.c, then rename cjpegalt.c to
  25. cjpeg.c.
  26. Rename the standard djpeg.c file to djpegstd.c, then rename djpegalt.c to
  27. djpeg.c.
  28. Then build the software as described in install.txt, with these exceptions:
  29. * Define PROGRESS_REPORT in jconfig.h if you want the percent-done display.
  30. * Define NO_OVERWRITE_CHECK if you *don't* want overwrite confirmation.
  31. * You may ignore the USE_SETMODE and TWO_FILE_COMMANDLINE symbols discussed
  32. in install.txt; these files do not use them.
  33. * As given, djpegalt.c defaults to BMP output (not PPM output as in the
  34. standard djpeg.c). If you want something different, modify DEFAULT_FMT.
  35. You may also need to do something special to enable filename wild-card
  36. expansion, assuming your compiler has that capability at all.
  37. Modify the standard usage.txt file as described below. (If you want to use
  38. the Unix-style manual pages cjpeg.1 and djpeg.1, better fix them too.)
  39. To restore the standard user interface:
  40. Rename cjpeg.c to cjpegalt.c, then rename cjpegstd.c to cjpeg.c.
  41. Rename djpeg.c to djpegalt.c, then rename djpegstd.c to djpeg.c.
  42. Then recompile/rebuild.
  43. Here are some specific notes for popular MS-DOS compilers:
  44. Borland C:
  45. Add "-DMSDOS" to CFLAGS to enable use of the DOS memory determination code.
  46. Link with the standard library file WILDARGS.OBJ to get wild-card expansion.
  47. Microsoft C:
  48. Add "-DMSDOS" to CFLAGS to enable use of the DOS memory determination code.
  49. Link with the standard library file SETARGV.OBJ to get wild-card expansion.
  50. In the versions I've used, you must also add /NOE to the linker switches to
  51. avoid a duplicate-symbol error from including SETARGV.
  52. DJGPP (we recommend version 2.0 or later):
  53. Add "-DFREE_MEM_ESTIMATE=0" to CFLAGS. Wild-card expansion is automatic.
  54. USAGE
  55. =====
  56. Most of the standard usage.txt file also applies to the alternate version,
  57. but replace its "GENERAL USAGE" section with the text below. Edit the text
  58. as necessary if you don't support wildcards or overwrite checking. Be sure
  59. to fix the djpeg switch descriptions if you are not defaulting to PPM output.
  60. Also, if you've provided an accurate memory-estimation procedure, you can
  61. probably eliminate the HINTS related to the -maxmemory switch.
  62. GENERAL USAGE
  63. We provide two programs, cjpeg to compress an image file into JPEG format,
  64. and djpeg to decompress a JPEG file back into a conventional image format.
  65. The basic command line is:
  66. cjpeg [switches] list of image files
  67. or
  68. djpeg [switches] list of jpeg files
  69. Each file named is compressed or decompressed. The input file(s) are not
  70. modified; the output data is written to files which have the same names
  71. except for extension. cjpeg always uses ".jpg" for the output file name's
  72. extension; djpeg uses one of ".bmp", ".gif", ".ppm", ".rle", or ".tga",
  73. depending on what output format is selected by the switches.
  74. For example, to convert xxx.bmp to xxx.jpg and yyy.ppm to yyy.jpg, say:
  75. cjpeg xxx.bmp yyy.ppm
  76. On most systems you can use standard wildcards to specify the list of input
  77. files; for example, on DOS "djpeg *.jpg" decompresses all the JPEG files in
  78. the current directory.
  79. If an intended output file already exists, you'll be asked whether or not to
  80. overwrite it. If you say no, the program skips that input file and goes on
  81. to the next one.
  82. You can intermix switches and file names; for example
  83. djpeg -gif file1.jpg -targa file2.jpg
  84. decompresses file1.jpg into GIF format (file1.gif) and file2.jpg into Targa
  85. format (file2.tga). Only switches to the left of a given file name affect
  86. processing of that file; when there are conflicting switches, the rightmost
  87. one takes precedence.
  88. You can override the program's choice of output file name by using the
  89. -outfile switch, as in
  90. cjpeg -outfile output.jpg input.ppm
  91. -outfile only affects the first input file name to its right.
  92. The currently supported image file formats are: PPM (PBMPLUS color format),
  93. PGM (PBMPLUS grayscale format), BMP, GIF, Targa, and RLE (Utah Raster Toolkit
  94. format). (RLE is supported only if the URT library is available, which it
  95. isn't on most non-Unix systems.) cjpeg recognizes the input image format
  96. automatically, with the exception of some Targa-format files. You have to
  97. tell djpeg which format to generate.
  98. JPEG files are in the standard JFIF file format. There are other,
  99. less widely used JPEG-based file formats, but we don't support them.
  100. All switch names may be abbreviated; for example, -grayscale may be written
  101. -gray or -gr. Most of the "basic" switches can be abbreviated to as little as
  102. one letter. Upper and lower case are equivalent (-BMP is the same as -bmp).
  103. British spellings are also accepted (e.g., -greyscale), though for brevity
  104. these are not mentioned below.