diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-03-25 01:30:34 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-03-25 01:30:34 +0000 |
commit | 4c731873f76411195fd17185474e16690985e6a5 (patch) | |
tree | 04437534a7548bdd4f0cc13840a88696bbe3e2cd /converter/other/pamtogif.c | |
parent | 841fd6952ef0e7c1abfe415e083991ac6fdd7e21 (diff) | |
download | netpbm-mirror-4c731873f76411195fd17185474e16690985e6a5.tar.gz netpbm-mirror-4c731873f76411195fd17185474e16690985e6a5.tar.xz netpbm-mirror-4c731873f76411195fd17185474e16690985e6a5.zip |
Do monochrome fastpath for nInputComp == 1, not depth == 1
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@256 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/pamtogif.c')
-rw-r--r-- | converter/other/pamtogif.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/converter/other/pamtogif.c b/converter/other/pamtogif.c index 41c50178..68a445c6 100644 --- a/converter/other/pamtogif.c +++ b/converter/other/pamtogif.c @@ -1754,10 +1754,8 @@ computeColormapBw(struct pam * const pamP, tupletable const colormap = pnm_alloctupletable(pamP, 2); *mapPamP = *pamP; + mapPamP->depth = 1; - assert(mapPamP->depth == 1); - assert(mapPamP->maxval == 1); - colormap[0]->value = 1; colormap[0]->tuple[0] = PAM_BLACK; colormap[1]->value = 1; @@ -1839,7 +1837,7 @@ computeLibnetpbmColormap(struct pam * const pamP, readAndValidateColormapFromFile(mapfile, maxcolors, &tuplefreq, mapPamP, &colorCount, nInputComp, pamP->maxval); - else if (pamP->depth == 1 && pamP->maxval == 1 && !sort && + else if (nInputComp == 1 && pamP->maxval == 1 && !sort && pamP->height * pamP->width > 1) computeColormapBw(pamP, mapPamP, &colorCount, &tuplefreq); else |