diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2013-06-25 15:49:53 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2013-06-25 15:49:53 +0000 |
commit | bf1a28688e84d370b3c4a625117a504a64fd1ad8 (patch) | |
tree | 7071be4d8a19cd6203a1076fd3131e2e6e70ccd5 /lib/libpam.c | |
parent | 0e0b8950a4b33eedf777f97a6c97f24cc9155f6c (diff) | |
download | netpbm-mirror-bf1a28688e84d370b3c4a625117a504a64fd1ad8.tar.gz netpbm-mirror-bf1a28688e84d370b3c4a625117a504a64fd1ad8.tar.xz netpbm-mirror-bf1a28688e84d370b3c4a625117a504a64fd1ad8.zip |
Ignore -plain when program generates PAM
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1955 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/libpam.c')
-rw-r--r-- | lib/libpam.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/libpam.c b/lib/libpam.c index c99ebd54..f188f7d6 100644 --- a/lib/libpam.c +++ b/lib/libpam.c @@ -1046,9 +1046,7 @@ pnm_writepaminit(struct pam * const pamP) { switch (PAM_FORMAT_TYPE(pamP->format)) { case PAM_TYPE: - if (pm_plain_output) - pm_error("There is no plain version of PAM. -plain option " - "is not allowed"); + /* See explanation below of why we ignore 'pm_plain_output' here. */ fprintf(pamP->file, "P7\n"); writeComments(pamP); fprintf(pamP->file, "WIDTH %u\n", (unsigned)pamP->width); @@ -1108,6 +1106,23 @@ pnm_writepaminit(struct pam * const pamP) { +/* EFFECT OF -plain WHEN WRITING PAM FORMAT: + + Before Netpbm 10.63 (June 2013), pnm_writepaminit() did a pm_error() here + if 'pm_plain_output' was set (i.e. the user said -plain). But this isn't + really logical, because -plain is a global option for the program and here + we are just writing one image. As a global option, -plain must be defined + to have effect where it makes sense and have no effect where it doesn't. + Note that a program that generates GIF just ignores -plain. Note also that + a program could conceivably generate both a PPM image and a PAM image. + + Note also how we handle the other a user can request plain format: the + 'plainformat' member of the PAM struct. In the case of PAM, we ignore that + member. +*/ + + + void pnm_checkpam(const struct pam * const pamP, enum pm_check_type const checkType, |