diff options
Diffstat (limited to 'editor/pnmremap.c')
-rw-r--r-- | editor/pnmremap.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/editor/pnmremap.c b/editor/pnmremap.c index 0038f4d7..0c0096ba 100644 --- a/editor/pnmremap.c +++ b/editor/pnmremap.c @@ -1043,13 +1043,6 @@ copyRaster(struct pam * const inpamP, inrow = pnm_allocpamrow(inpamP); outrow = pnm_allocpamrow(&workpam); - if (outpamP->maxval != inpamP->maxval && defaultColor) - pm_error("The maxval of the colormap (%u) is not equal to the " - "maxval of the input image (%u). This is allowable only " - "if you are doing an approximate mapping (i.e. you don't " - "specify -firstisdefault or -missingcolor)", - (unsigned int)outpamP->maxval, (unsigned int)inpamP->maxval); - selectDepthAdjustment(inpamP, outpamP->depth, &depthAdjustment); usehash = TRUE; @@ -1120,6 +1113,13 @@ remap(FILE * const ifP, outpam.width = inpam.width; outpam.height = inpam.height; + if (outpam.maxval != inpam.maxval && defaultColor) + pm_error("The maxval of the colormap (%u) is not equal to the " + "maxval of the input image (%u). This is allowable only " + "if you are doing an approximate mapping (i.e. you don't " + "specify -firstisdefault or -missingcolor)", + (unsigned int)outpam.maxval, (unsigned int)inpam.maxval); + pnm_writepaminit(&outpam); /* Set up so input buffers have extra space as needed to |