PAMFILE(1)

๐Ÿ’– PAMFILE(1) โ€” the Pamfile User Manual, but make it a group chat ๐Ÿ’–

okay bestie, welcome to the General Commands Manual section, where we're gonna talk about pamfile and why she's the low-key queen of "what even IS this file" ๐ŸŽ€


โœจ NAME โœจ

pamfile โ€” describe a Netpbm (PAM or PNM) file ๐Ÿฆ‹


โœจ SYNOPSIS โœจ

pamfile

[-allimages] [-comments] [-count] [-machine] [-size]

[file ...]

fr fr, some quality-of-life notes before you type anything:

  • Minimum unique abbreviations of options are acceptable. so -all is giving -allimages energy and that's fine ๐Ÿ’…
  • You may use double hyphens instead of single hyphen to denote options. yes bestie, --allimages slays just as hard.
  • You may use white space in place of the equals sign to separate an option name from its value. so chill, you don't have to be all = about it.

โœจ DESCRIPTION โœจ

This program is part of Netpbm(1). ๐Ÿซถ

So here's the vibe: pamfile reads one or more Netpbm files as input and writes out short descriptions of the image type, size, etc. It's partly for use in shell scripts, so the format is not particularly pretty โ€” and honestly? she knows. she's not here to be pretty, she's here to be useful. ๐Ÿ’€

By default, pamfile reads only the header of the input file. and like... if that file is a pipe, that might cause problems for the process that is feeding the pipe ๐Ÿ˜ญ the pipe-feeder is just sitting there waiting for someone to consume the rest and nobody's coming. in that case, see the -allimages option. she's got you.


โœจ OPTIONS โœจ

In addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), pamfile recognizes the following command line options:

  • -allimages โ€” okay so this option causes pamfile to describe every image in each input file. Without this option, pamfile describes only the first image in each input file. ๐Ÿ‘‘

This option also causes pamfile to read all the images from the input stream, whereas without it, pamfile reads only the header of the first one. If the input stream is from a pipe, the process that is feeding the pipe might require the entire stream to be consumed. In that case, use this option even if the stream contains only one image. yes even if it's just one!! the pipe needs the closure!!! ๐ŸŒˆ

This option has no effect if you also specify -count.

Note that before July 2000, a file could not contain more than one image and many programs ignore all but the first. ancient times fr fr ๐Ÿฆ•

This option was new in Netpbm 9.5 (July 2000).

  • -comments โ€” this option causes pamfile to include for each PAM image a report of the comments from the header of the image. ๐Ÿ“

For a PBM, PGM, or PPM image, pamfile reports there are no comments, even if there are. yeah. she's not lying to you, she's just built different. ๐Ÿ’€

This option was new in Netpbm 10.35 (August 2006).

  • -count โ€” this option causes pamfile to display only a count of how many images are in each input file. just a number. a little census. ๐Ÿงฎ

As with -allimages, this causes pamfile to read all the images.

You may specify at most one of -count, -machine, and -size. pick ONE bestie, this isn't a build-your-own-flag situation ๐Ÿ™ˆ

This option was new with Netpbm 10.31 (December 2005).

  • -machine โ€” This makes the output more convenient for a machine to use, while less convenient for a human. pamfile reports the same information as with no options. ๐Ÿค–

The output is one line of ASCII text per image. Each line consists of the file name, followed by a colon, followed by a space, then the following tokens with a space in between:

  • Format: 'PAM', 'PBM', 'PGM', or 'PPM',
  • Subformat: 'PLAIN' or 'RAW'
  • Width: in pixels, in decimal
  • Height: in pixels, in decimal
  • Depth: in decimal
  • Maxval: in decimal (1 if image is PBM)
  • Tuple type (emulated if the image is not PAM)

You may specify at most one of -count, -machine, and -size. one. singular. ๐Ÿ’…

This option was new in Netpbm 10.86 (March 2019).

  • -size โ€” This makes the output contain only the height and width of the image, in a form convenient for machine processing. ๐Ÿ“

There is one line of output per image, consisting of two blank-delimited tokens:

  • Width: in pixels, in decimal
  • Height: in pixels, in decimal

Note that there is no way to tell which image is in which file, if you have multiple input files with multiple images. ๐Ÿ˜ญ if that is your case, use -machine instead. she said what she said.

You may specify at most one of -count, -machine, and -size. (yes again. it's that serious.)

This option was new in Netpbm 10.86 (March 2019).


โœจ SEE ALSO โœจ

pam(1), ppmhist(1), file ๐ŸŒธ


โœจ AUTHOR โœจ

Copyright (C) 1991 by Jef Poskanzer. shoutout to the OG ๐Ÿ‘‘


โœจ DOCUMENT SOURCE โœจ

This manual page was generated by the Netpbm tool makeman from HTML source. The master documentation is at

http://netpbm.sourceforge.net/doc/pamfile.html

okay that's the whole page bestie, you're officially certified in pamfile ๐Ÿ’– ๐Ÿฆ‹ this was documented by netpbm documentation, version-dated 04 July 2020, and honestly? she ate. periodt. ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from