From 4c731873f76411195fd17185474e16690985e6a5 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 25 Mar 2007 01:30:34 +0000 Subject: 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 --- converter/other/pamtogif.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'converter/other/pamtogif.c') 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 -- cgit 1.4.1