diff options
Diffstat (limited to '3rdparty/libjpeg/djpeg.c')
-rw-r--r-- | 3rdparty/libjpeg/djpeg.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/3rdparty/libjpeg/djpeg.c b/3rdparty/libjpeg/djpeg.c index 0c9b89bdd5f..a01b3968477 100644 --- a/3rdparty/libjpeg/djpeg.c +++ b/3rdparty/libjpeg/djpeg.c @@ -2,7 +2,7 @@ * djpeg.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2009-2015 by Guido Vollbeding. + * Modified 2009-2019 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -59,7 +59,8 @@ static const char * const cdjpeg_message_table[] = { typedef enum { FMT_BMP, /* BMP format (Windows flavor) */ - FMT_GIF, /* GIF format */ + FMT_GIF, /* GIF format (LZW compressed) */ + FMT_GIF0, /* GIF format (uncompressed) */ FMT_OS2, /* BMP format (OS/2 flavor) */ FMT_PPM, /* PPM/PGM (PBMPLUS formats) */ FMT_RLE, /* RLE format */ @@ -111,8 +112,10 @@ usage (void) (DEFAULT_FMT == FMT_BMP ? " (default)" : "")); #endif #ifdef GIF_SUPPORTED - fprintf(stderr, " -gif Select GIF output format%s\n", + fprintf(stderr, " -gif Select GIF output format (LZW compressed)%s\n", (DEFAULT_FMT == FMT_GIF ? " (default)" : "")); + fprintf(stderr, " -gif0 Select GIF output format (uncompressed)%s\n", + (DEFAULT_FMT == FMT_GIF0 ? " (default)" : "")); #endif #ifdef BMP_SUPPORTED fprintf(stderr, " -os2 Select BMP output format (OS/2 style)%s\n", @@ -195,7 +198,7 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, arg++; /* advance past switch marker character */ if (keymatch(arg, "bmp", 1)) { - /* BMP output format. */ + /* BMP output format (Windows flavor). */ requested_fmt = FMT_BMP; } else if (keymatch(arg, "colors", 1) || keymatch(arg, "colours", 1) || @@ -258,9 +261,13 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, cinfo->do_fancy_upsampling = FALSE; } else if (keymatch(arg, "gif", 1)) { - /* GIF output format. */ + /* GIF output format (LZW compressed). */ requested_fmt = FMT_GIF; + } else if (keymatch(arg, "gif0", 4)) { + /* GIF output format (uncompressed). */ + requested_fmt = FMT_GIF0; + } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) { /* Force monochrome output. */ cinfo->out_color_space = JCS_GRAYSCALE; @@ -461,7 +468,7 @@ main (int argc, char **argv) * APP12 is used by some digital camera makers for textual info, * so we provide the ability to display it as text. * If you like, additional APPn marker types can be selected for display, - * but don't try to override APP0 or APP14 this way (see libjpeg.doc). + * but don't try to override APP0 or APP14 this way (see libjpeg.txt). */ jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker); jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker); @@ -554,7 +561,10 @@ main (int argc, char **argv) #endif #ifdef GIF_SUPPORTED case FMT_GIF: - dest_mgr = jinit_write_gif(&cinfo); + dest_mgr = jinit_write_gif(&cinfo, TRUE); + break; + case FMT_GIF0: + dest_mgr = jinit_write_gif(&cinfo, FALSE); break; #endif #ifdef PPM_SUPPORTED @@ -574,7 +584,6 @@ main (int argc, char **argv) #endif default: ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT); - break; } dest_mgr->output_file = output_file; |