diff options
Diffstat (limited to 'converter/other/giftopnm.c')
-rw-r--r-- | converter/other/giftopnm.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/converter/other/giftopnm.c b/converter/other/giftopnm.c index 470c85b7..55d7ccc6 100644 --- a/converter/other/giftopnm.c +++ b/converter/other/giftopnm.c @@ -113,10 +113,7 @@ parseCommandLine(int argc, const char ** argv, Note that the file spec array we return is stored in the storage that was passed to us as the argv array. -----------------------------------------------------------------------------*/ - optEntry * option_def; - /* Instructions to pm_optParseOptions3 on how to parse our options. - */ - + optEntry * option_def; /* Used by OPTENT3 */ optStruct3 opt; unsigned int alphaSpec, imageSpec; @@ -144,7 +141,7 @@ parseCommandLine(int argc, const char ** argv, opt.short_allowed = false; /* We have no short (old-fashioned) options */ opt.allowNegNum = false; /* We have no parms that are negative numbers */ - pm_optParseOptions3(&argc, (char **)argv, opt, sizeof(opt), 0); + pm_optParseOptions4(&argc, argv, opt, sizeof(opt), 0); /* Uses and sets argc, argv, and some of *cmdlineP and others. */ free(option_def); @@ -291,6 +288,7 @@ initGif89(struct Gif89 * const gif89P) { } + static bool verbose; static bool showComment; @@ -1237,7 +1235,6 @@ lzwReadByteFresh(struct GetCodeState * const getCodeStateP, - static void lzwReadByte(Decompressor * const decompP, unsigned char * const dataReadP, @@ -1357,6 +1354,7 @@ bumpRowInterlace(unsigned int const rows, } + static void renderRow(unsigned char * const cmapIndexRow, unsigned int const cols, @@ -1448,20 +1446,14 @@ pnmFormat(bool const hasGray, by 'hasGray' and 'hasColor'. -----------------------------------------------------------------------------*/ int format; - const char * formatName; if (hasColor) { format = PPM_FORMAT; - formatName = "PPM"; } else if (hasGray) { format = PGM_FORMAT; - formatName = "PGM"; } else { format = PBM_FORMAT; - formatName = "PBM"; } - if (verbose) - pm_message("writing a %s file", formatName); return format; } @@ -1554,6 +1546,9 @@ convertRaster(Decompressor * const decompP, MALLOCARRAY2(cmapIndexArray, interlace ? rows : 1 , cols); + if (verbose) + pm_message("writing a %s file", pnm_formattypenm(format)); + if (imageOutFileP) pnm_writepnminit(imageOutFileP, cols, rows, GIFMAXVAL, format, false); if (alphaFileP) @@ -2198,3 +2193,4 @@ main(int argc, const char **argv) { } + |