diff options
Diffstat (limited to 'converter/ppm')
-rw-r--r-- | converter/ppm/ilbmtoppm.c | 2 | ||||
-rw-r--r-- | converter/ppm/leaftoppm.c | 4 | ||||
-rw-r--r-- | converter/ppm/picttoppm.c | 21 |
3 files changed, 22 insertions, 5 deletions
diff --git a/converter/ppm/ilbmtoppm.c b/converter/ppm/ilbmtoppm.c index 8bb72662..dab30425 100644 --- a/converter/ppm/ilbmtoppm.c +++ b/converter/ppm/ilbmtoppm.c @@ -2351,7 +2351,7 @@ main(int argc, char *argv[]) { cmap_to_ppm(cmap); } else pm_error("no colormap"); - } else if( bodyChunkProcessed ) { + } else if( !bodyChunkProcessed ) { if( HAS_COLORMAP(cmap) ) { pm_message("input is a colormap file"); check_cmap(bmhdP, cmap); diff --git a/converter/ppm/leaftoppm.c b/converter/ppm/leaftoppm.c index 889400f6..bda44494 100644 --- a/converter/ppm/leaftoppm.c +++ b/converter/ppm/leaftoppm.c @@ -88,9 +88,9 @@ leaf_init(FILE * const fp, for (i=0; i < 256; ++i) PPM_PUTR(colors[i], fgetc(fp)); for (i=0; i < 256; ++i) - PPM_PUTR(colors[i], fgetc(fp)); + PPM_PUTG(colors[i], fgetc(fp)); for (i=0; i < 256; ++i) - PPM_PUTR(colors[i], fgetc(fp)); + PPM_PUTB(colors[i], fgetc(fp)); *ncolorsP = ncolors; } else { /* 24-bit image */ diff --git a/converter/ppm/picttoppm.c b/converter/ppm/picttoppm.c index 6f34dae4..a89c3086 100644 --- a/converter/ppm/picttoppm.c +++ b/converter/ppm/picttoppm.c @@ -4056,6 +4056,23 @@ interpret_pict(FILE * const ofP) { +static void +loadDefaultFontDir(void) { +/*---------------------------------------------------------------------------- + Load the fonts from the font directory file "fontdir" (in the current + directory), if it exists. +-----------------------------------------------------------------------------*/ + struct stat statbuf; + int rc; + + rc = stat("fontdir", &statbuf); + + if (rc == 0) + load_fontdir("fontdir"); +} + + + int main(int argc, char * argv[]) { int argn; @@ -4092,8 +4109,6 @@ main(int argc, char * argv[]) { ++argn; } - load_fontdir("fontdir"); - if (argn < argc) { ifp = pm_openr(argv[argn]); ++argn; @@ -4103,6 +4118,8 @@ main(int argc, char * argv[]) { if (argn != argc) pm_usage(usage); + loadDefaultFontDir(); + if (header) { stage = "Reading 512 byte header"; skip(512); |