diff options
Diffstat (limited to 'converter/other/jpegtopnm.c')
-rw-r--r-- | converter/other/jpegtopnm.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/converter/other/jpegtopnm.c b/converter/other/jpegtopnm.c index 518d80ac..33f69be9 100644 --- a/converter/other/jpegtopnm.c +++ b/converter/other/jpegtopnm.c @@ -53,7 +53,7 @@ #define _XOPEN_SOURCE 500 /* Make sure strdup() is in string.h */ #include <stdbool.h> -#include <ctype.h> /* to declare isprint() */ +#include <ctype.h> /* to declare isprint() */ #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -142,6 +142,7 @@ interpretMaxmemory(bool const maxmemorySpec, } + static void interpretAdobe(int const adobe, int const notadobe, @@ -265,6 +266,7 @@ parseCommandLine(int const argc, } + /* * Marker processor for COM and interesting APPn markers. * This replaces the library's built-in processor, which just skips the marker. @@ -288,6 +290,7 @@ jpegGetc (j_decompress_ptr const cinfoP) { } + static bool printTextMarker(j_decompress_ptr const cinfoP) { /*---------------------------------------------------------------------------- @@ -320,12 +323,12 @@ printTextMarker(j_decompress_ptr const cinfoP) { length = jpeg_getc(cinfoP) << 8; length += jpeg_getc(cinfoP); - length -= 2; /* discount the length word itself */ + length -= 2; /* discount the length word itself */ if (traceit) { if (cinfoP->unread_marker == JPEG_COM) fprintf(stderr, "Comment, length %ld:\n", (long) length); - else /* assume it is an APPn otherwise */ + else /* assume it is an APPn otherwise */ fprintf(stderr, "APP%d, length %ld:\n", cinfoP->unread_marker - JPEG_APP0, (long) length); } @@ -409,6 +412,7 @@ printMarker(struct jpeg_marker_struct const marker) { } + typedef struct rgb {unsigned int r; unsigned int g; unsigned int b;} rgb_type; @@ -551,8 +555,7 @@ setColorSpaces(J_COLOR_SPACE const jpegColorSpace, pm_error("INTERNAL ERROR: unknown color space code %d passed " "to setColorSpaces().", jpegColorSpace); } - pm_message("WRITING %s FILE", - *outputTypeP == PPM_TYPE ? "PPM" : "PGM"); + pm_message("WRITING %s FILE", pnm_formattypenm(*outputTypeP)); } @@ -916,7 +919,6 @@ convertImage(FILE * const ofP, - static void saveMarkers(struct jpeg_decompress_struct * const cinfoP) { |