Input and output

jpeg2afp can process either standard input or multiple files specified on the command line. If no input file is specified, stdin is assumed. Standard input is cached to a file (see the -wrkdir option) and then processed. Only a single JPEG file should be submitted using stdin. If multiple JPEG files are concatenated using standard input, all except the first one are ignored.

If an input file is specified on the command line, it can be either a JPEG file, a directory, or a file list (-f and @ prefixes). Multiple input file specifications are allowed. The transform processes each file in the order in which it was specified on the command line. If the -z option is specified, a list of file names to be processed is also submitted using standard input. The files on the list are processed as if the list were given with the -f option on the same place on the command line as -z.

If the file name points to a directory, jpeg2afp processes every file in that directory. The files are processed in the order they would be shown using the ls -a command. Directory search is not recursive, that is, the subdirectories are not searched.

If the file name is preceded by the -f option or the at sign (@), jpeg2afp assumes that the file contains the list of JPEG files to be processed. Each of the files in the list is processed in the order it was listed.

If a JPEG file has the extension .jpg, .jpeg, .JPG, or .JPEG, this extension need not be given explicitly. jpeg2afp first tries to open the file as specified, and if unsuccessful, tries to append the extensions .jpg.jpeg, .JPG, and .JPEG in turn.

For example, suppose that:

  • The directory tFiles contains the files file1.jpg, file2.jpg, file3.jpg, and file4.jpg and nothing else.
  • The file flist in the current directory contains the two file names tFiles/file2.jpg and tFiles/file3.jpg. The names listed in the file list can have their extensions omitted.
  • The file flist2 contains the file name tFiles/file4. Again, the names listed in the file list can have their extensions omitted.

To process files file1.jpg, file2.jpg, file3.jpg, and file4.jpg, any of these invocations of jpeg2afp would work:

jpeg2afp tFiles/file1.jpg tFiles/file2.jpg tFiles/file3.jpg 
															tFiles/file4.jpg
jpeg2afp tFiles/file1 tFiles/file2 tFiles/file3 tFiles/file4
jpeg2afp tFiles/file*.jpg
jpeg2afp tFiles
jpeg2afp tFiles/file1 -fflist tFiles/file4
jpeg2afp tFiles/file1 -f flist tFiles/file4
jpeg2afp tFiles/file1 -f flist -f flist2
jpeg2afp tFiles/file1 @flist @flist2
Note: With InfoPrint Manager for Windows, you can enter separators in path names as backward slashes or forward slashes.

The file list files allow the display text to be added for each file. A display text is any text starting with the pound character (#) and extending to the end of the line. The display text should follow the file name and can extend over several lines, up to 2048 characters long. The initial # character on each line is discarded. If a display text is present for a file name, that text is displayed in the status and error messages instead of the file name. This is useful if jpeg2afp is invoked using temporary files whose names are meaningless to the user. Any display text before the first file name is treated as comment and discarded. Display text is allowed also if you use the -z option to submit the file list using standard input.

The output file name can be either specified explicitly with the -o option or derived from the input file name. If multiple input files have been specified, the default output file is standard output. If a single input file is given and the output file is not specified explicitly, the transform strips the .jpg or .jpeg extension from the input file name (if one is present) and appends the .afp extension for AFP output or the .ps extension for PostScript output, to get the output file name.

To disable automatic output file name generation and force the default output stream to be the standard output in all cases, set the environment variable JPEG2AFP_o to - or stdout, or alternatively, put the line o=- or o=stdout into the configuration file and invoke that configuration file using the -C option or the JPEG2AFP_C environment variable.

For example, all these commands:

jpeg2afp myfile
jpeg2afp myfile.jpg
jpeg2afp myfile -o myfile.afp
have myfile.afp as the output file. There is no requirement for the explicitly specified input and output files to have .jpg and .afp extensions. To process JPEG file foo.bar into an AFP file foo.bar2, invoke the transform using:
jpeg2afp foo.bar -o foo.bar2

The output data stream is MODCA-P or PostScript Level 2. MODCA-P data can be encoded as IM1 or IOCA Function Sets (FS) 10, 11, 42, or 45. IM1 images are bi-level and uncompressed. Function Set 42 is tiled, while Function Sets 10 and 11 are not. All IOCA function sets can contain bi-level image data. In addition, Function Set 11 can also contain 4- and 8-bit grayscale, as well as 24 bit (8 bits per plane) YCbCr color. In addition to bi-level images, Function Set 42 can also contain 4-bit (1 bit per plane) CMYK data. The InfoPrint Color 100 AFP printer fully implements IOCA FS42. Function Set 45 is a superset of FS42 and supports 32-bit (8 bits per plane) CMYK images, as well as transparency masks and different relative resolutions. FS45 is implemented in the InfoPrint Color 130 Plus printer.

While FS45 and FS42 can contain image divided into a number of tiles, the transform currently outputs the image in a single tile. The IOCA output image data can be either uncompressed or compressed using one of several algorithms (see the -cmp option). The default compression algorithm for bi-level image data is ITU-TSS T.6 Group 4, while the compression algorithm for grayscale and YCbCr defaults to no compression. CMYK images in FS42 are carried in the planar (banded) format, and each band is compressed separately as a bi-level image.

The default compression for FS45 output is JPEG, which is downsampled by a factor of two. Use -cmp lzw to obtain LZW-uncompressed, unsubsampled output.

Note: LZW compression should be used only for linework images and not for continuous tone images.

PostScript Level 2 images can be uncompressed or ITU-T T.6 Group 4 bi-level, uncompressed 8-bit grayscale or uncompressed 24-bit RGB color. By default, the transform leaves scaling and halftoning to the printer (that is, color JPEG images are output as 24-bit RGB color images).