By default, pamfile reads only the header of the input file. If that file is a pipe, that might cause problems for the process that is feeding the pipe. In that case, see the -allimages option.
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.
Note that before July 2000, a file could not contain more than one image and many programs ignore all but the first.