| 1 |
\ |
| 2 |
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source. |
| 3 |
.\" Do not hand-hack it! If you have bug fixes or improvements, please find |
| 4 |
.\" the corresponding HTML page on the Netpbm website, generate a patch |
| 5 |
.\" against that, and send it to the Netpbm maintainer. |
| 6 |
.TH "Pamfix User Manual" 1 "06 March 2014" "netpbm documentation" |
| 7 |
|
| 8 |
.SH NAME |
| 9 |
|
| 10 |
pamfix - repair a Netpbm image with various corruptions |
| 11 |
|
| 12 |
.UN synopsis |
| 13 |
.SH SYNOPSIS |
| 14 |
|
| 15 |
\fBpamfix\fP |
| 16 |
|
| 17 |
[\fB-truncate\fP] |
| 18 |
[\fB-changemaxval\fP] |
| 19 |
[\fB-clip\fP] |
| 20 |
[\fB-verbose\fP] |
| 21 |
|
| 22 |
[\fInetpbmfile\fP] |
| 23 |
.PP |
| 24 |
Minimum unique abbreviation of option is acceptable. You may use double |
| 25 |
hyphens instead of single hyphen to denote options. You may use white |
| 26 |
space in place of the equals sign to separate an option name from its value. |
| 27 |
|
| 28 |
|
| 29 |
.UN description |
| 30 |
.SH DESCRIPTION |
| 31 |
.PP |
| 32 |
This program is part of |
| 33 |
.BR "Netpbm" (1)\c |
| 34 |
\&. |
| 35 |
.PP |
| 36 |
\fBpamfix\fP reads a stream that is mostly a Netpbm image but may have |
| 37 |
certain types of corruptions and produces a valid Netpbm image that preserves |
| 38 |
much of the information in the original. |
| 39 |
|
| 40 |
In particular, Netpbm salvages streams that are truncated and that contain |
| 41 |
illegally large sample values. |
| 42 |
.PP |
| 43 |
\fBpamfix\fP looks at only on the first image in a multi-image stream. |
| 44 |
|
| 45 |
|
| 46 |
.UN truncatedstream |
| 47 |
.SS Truncated Stream |
| 48 |
.PP |
| 49 |
This is a stream that is missing the last part. Netpbm corrects this |
| 50 |
by creating an output image that simply has fewer rows. |
| 51 |
.PP |
| 52 |
You select this kind of repair with a \fB-truncate\fP option. |
| 53 |
.PP |
| 54 |
The header of a Netpbm image implies how large the image must |
| 55 |
be (how many bytes the file must contain). If the file is actually |
| 56 |
smaller than that, a Netpbm program that tries to read the image |
| 57 |
fails, with an error message telling you that it couldn't read the |
| 58 |
whole file. The data in the file is arranged in row order, from |
| 59 |
top to bottom, and the most common reason for the file being smaller |
| 60 |
than its header says it should be is because the bottommost rows are |
| 61 |
simply missing. So \fBpamfix\fP assumes that is the case |
| 62 |
and generates a new image with just the rows that are readable. |
| 63 |
(technically, that means the output's header indicates a smaller |
| 64 |
number of rows and omits any partial last row). |
| 65 |
.PP |
| 66 |
The most common way for a Netpbm file to be small is that something |
| 67 |
interrupted the program that generated it before it was finished writing |
| 68 |
the file. For example, the program ran out of its own input or |
| 69 |
encountered a bug or ran out of space in which to write the output. |
| 70 |
.PP |
| 71 |
Another problem \fBpamfix\fP deals with is where the file isn't |
| 72 |
actually too small, but because of a system error, a byte in the middle of |
| 73 |
it cannot be read (think of a disk storage failure). \fBpamfix\fP |
| 74 |
reads the input sequentially until it can't read any further, for any |
| 75 |
reason. So it treats such an image as a truncated one, ignoring all |
| 76 |
data after the unreadable byte. |
| 77 |
.PP |
| 78 |
But be aware that an image file is sometimes too small because of a |
| 79 |
bug in the program that generated it, and in that case it is not |
| 80 |
simply a matter of the bottom of the image missing, so |
| 81 |
\fBpamfix\fP simply creates a valid Netpbm image containing a |
| 82 |
garbage picture. |
| 83 |
.PP |
| 84 |
If you want to test an image file to see if it is corrupted by being |
| 85 |
too small, use \fBpamfile --allimages\fP . It fails with an error |
| 86 |
message if the file is too small. |
| 87 |
.PP |
| 88 |
If you want to cut the bottom off a valid Netpbm image, use |
| 89 |
\fBpamcut\fP. |
| 90 |
|
| 91 |
|
| 92 |
.UN excessivesample |
| 93 |
.SS Excessive Sample Value |
| 94 |
.PP |
| 95 |
This is a stream that contains a purported sample value that is higher than |
| 96 |
the maxval of the image. |
| 97 |
.PP |
| 98 |
The header of a Netpbm image tells the maxval of the image, which is a |
| 99 |
value that gives meaning to all the sample values in the raster. The |
| 100 |
sample values represent a fraction of the maxval, so a sample value that is |
| 101 |
greater than the maxval makes no sense. |
| 102 |
.PP |
| 103 |
A regular Netpbm program fails if you give it input that contains a value |
| 104 |
larger than the maxval where a sample value belongs. |
| 105 |
.PP |
| 106 |
\fBpamfix\fP has three ways of salvaging such a stream: |
| 107 |
|
| 108 |
|
| 109 |
.IP \(bu |
| 110 |
Clip to the maxval. Request this with \fB-clip\fP. |
| 111 |
.IP \(bu |
| 112 |
Raise the maxval, thus lowering the fraction represented by every sample |
| 113 |
in the image. Request this with \fB-changemaxval\fP. |
| 114 |
.IP \(bu |
| 115 |
Truncate the image at the first invalid sample value. Request this with |
| 116 |
\fB-truncate\fP and neither \fB-clip\fP nor \fB-changemaxval\fP. |
| 117 |
|
| 118 |
.PP |
| 119 |
You cannot specify both \fB-clip\fP and \fB-changemaxval\fP. |
| 120 |
|
| 121 |
|
| 122 |
.UN options |
| 123 |
.SH OPTIONS |
| 124 |
.PP |
| 125 |
In addition to the options common to all programs based on libnetpbm |
| 126 |
(most notably \fB-quiet\fP, see |
| 127 |
.UR index.html#commonoptions |
| 128 |
Common Options |
| 129 |
.UE |
| 130 |
\&), \fBpamfix\fP recognizes the following |
| 131 |
command line options: |
| 132 |
|
| 133 |
|
| 134 |
.TP |
| 135 |
\fB-truncate\fP |
| 136 |
Create a truncated output image from all the valid input rows that |
| 137 |
could be read. |
| 138 |
|
| 139 |
.TP |
| 140 |
\fB-changemaxval\fP |
| 141 |
Raise the maxval to cope with pixel values that exceed the maxval |
| 142 |
stated in the header of the input file. |
| 143 |
|
| 144 |
.TP |
| 145 |
\fB-clip\fP |
| 146 |
Change all pixel values that exceed the maxval stated in the header |
| 147 |
of the input file. |
| 148 |
|
| 149 |
.TP |
| 150 |
\fB-verbose\fP |
| 151 |
Report details of the transportation to standard error. |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
.UN seealso |
| 156 |
.SH SEE ALSO |
| 157 |
.BR "pnm" (1)\c |
| 158 |
\&, |
| 159 |
.BR "pam" (1)\c |
| 160 |
\&, |
| 161 |
.BR "pamcut" (1)\c |
| 162 |
\&, |
| 163 |
.BR "pamfile" (1)\c |
| 164 |
\&, |
| 165 |
.BR "pamvalidate" (1)\c |
| 166 |
\& |
| 167 |
|
| 168 |
.UN history |
| 169 |
.SH HISTORY |
| 170 |
.PP |
| 171 |
\fBpamfix\fP was new in Netpbm 10.66 (March 2014). But it grew out of |
| 172 |
\fBpamfixtrunc\fP, which was new in Netpbm 10.38 (March 2007) and did only |
| 173 |
the truncated image repair (and for invalid sample values would simply pass |
| 174 |
them through to its output, generating an invalid Netpbm image). |
| 175 |
.SH DOCUMENT SOURCE |
| 176 |
This manual page was generated by the Netpbm tool 'makeman' from HTML |
| 177 |
source. The master documentation is at |
| 178 |
.IP |
| 179 |
.B http://netpbm.sourceforge.net/doc/pamfix.html |
| 180 |
.PP |