diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-07-30 16:19:22 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-07-30 16:19:22 +0000 |
commit | 8d52ce5e21903e601e6bda24ad715b4a77259009 (patch) | |
tree | 987580d5e6116e82189138c11f7c8d66c1c22211 /converter | |
parent | 5847a7a3b80d5a6922dbf13ac8dc7d5eef6d270e (diff) | |
download | netpbm-mirror-8d52ce5e21903e601e6bda24ad715b4a77259009.tar.gz netpbm-mirror-8d52ce5e21903e601e6bda24ad715b4a77259009.tar.xz netpbm-mirror-8d52ce5e21903e601e6bda24ad715b4a77259009.zip |
Release 10.35.30
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@368 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter')
-rw-r--r-- | converter/other/pnmtops.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c index 9f6de526..eb9cbf6f 100644 --- a/converter/other/pnmtops.c +++ b/converter/other/pnmtops.c @@ -971,16 +971,29 @@ computeDepth(xelval const inputMaxval, *bitspersampleP = 2; else if (bitsRequiredByMaxval <= 4) *bitspersampleP = 4; - else if (bitsRequiredByMaxval <= 8 || postscriptLevel < 2) + else *bitspersampleP = 8; - else - *bitspersampleP = 12; - if (*bitspersampleP < bitsRequiredByMaxval) - pm_message("Maxval of input requires %u bit samples for full " - "resolution, but we are using the Postscript level %u " - "maximum of %u", - bitsRequiredByMaxval, postscriptLevel, *bitspersampleP); + /* There is supposedly a 12 bits per pixel Postscript format, but + what? We produce a raster that is composed of bytes, each + coded as a pair of hexadecimal characters and representing 8, + 4, 2, or 1 pixels. We also have the RLE format, where some of + those bytes are run lengths. + */ + + if (*bitspersampleP < bitsRequiredByMaxval) { + if (bitsRequiredByMaxval <= 12 && postscriptLevel >= 2) + pm_message("Maxval of input requires %u bit samples for full " + "resolution, and Postscript level %u is capable " + "of representing that many, but this program " + "doesn't know how. So we are using %u", + bitsRequiredByMaxval, postscriptLevel, *bitspersampleP); + else + pm_message("Maxval of input requires %u bit samples for full " + "resolution, but we are using the Postscript level %u " + "maximum of %u", + bitsRequiredByMaxval, postscriptLevel, *bitspersampleP); + } *psMaxvalP = pm_bitstomaxval(*bitspersampleP); |