diff --git a/ChangeLog.txt b/ChangeLog.txt index e21ef968..f0d126b4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -32,6 +32,9 @@ for such images are ignored by the decompressor. However, the TurboJPEG API was being too rigid and was expecting the sampling factors to be equal to 1 before it treated the image as a grayscale JPEG. +[8] cjpeg, djpeg, and jpegtran now accept an argument of -version, which will +print the library version and exit. + 1.3.90 (1.4 beta1) ================== diff --git a/cjpeg.1 b/cjpeg.1 index 5f5090cf..e338c80c 100644 --- a/cjpeg.1 +++ b/cjpeg.1 @@ -1,4 +1,4 @@ -.TH CJPEG 1 "11 May 2014" +.TH CJPEG 1 "21 November 2014" .SH NAME cjpeg \- compress an image file to a JPEG file .SH SYNOPSIS @@ -221,6 +221,9 @@ give more output. Also, version information is printed at startup. .B \-debug Same as .BR \-verbose . +.TP +.B \-version +Print version information and exit. .PP The .B \-restart diff --git a/cjpeg.c b/cjpeg.c index a7d25047..af946d28 100644 --- a/cjpeg.c +++ b/cjpeg.c @@ -5,7 +5,7 @@ * Copyright (C) 1991-1998, Thomas G. Lane. * Modified 2003-2011 by Guido Vollbeding. * libjpeg-turbo Modifications: - * Copyright (C) 2010, 2013, D. R. Commander. + * Copyright (C) 2010, 2013-2014, D. R. Commander. * For conditions of distribution and use, see the accompanying README file. * * This file contains a command-line user interface for the JPEG compressor. @@ -192,6 +192,7 @@ usage (void) fprintf(stderr, " -memdst Compress to memory instead of file (useful for benchmarking)\n"); #endif fprintf(stderr, " -verbose or -debug Emit debug output\n"); + fprintf(stderr, " -version Print version information and exit\n"); fprintf(stderr, "Switches for wizards:\n"); fprintf(stderr, " -baseline Force baseline quantization tables\n"); fprintf(stderr, " -qtables file Use quantization tables given in file\n"); @@ -289,8 +290,14 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, JVERSION); printed_version = TRUE; } + cinfo->err->trace_level++; + } else if (keymatch(arg, "version", 4)) { + fprintf(stderr, "%s version %s (build %s)\n", + PACKAGE_NAME, VERSION, BUILD); + exit(EXIT_SUCCESS); + } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) { /* Force a monochrome JPEG file to be generated. */ jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); diff --git a/djpeg.1 b/djpeg.1 index 9b040ae9..73d05148 100644 --- a/djpeg.1 +++ b/djpeg.1 @@ -1,4 +1,4 @@ -.TH DJPEG 1 "11 May 2014" +.TH DJPEG 1 "21 November 2014" .SH NAME djpeg \- decompress a JPEG file to an image file .SH SYNOPSIS @@ -202,6 +202,9 @@ give more output. Also, version information is printed at startup. .B \-debug Same as .BR \-verbose . +.TP +.B \-version +Print version information and exit. .SH EXAMPLES .LP This example decompresses the JPEG file foo.jpg, quantizes it to diff --git a/djpeg.c b/djpeg.c index 7c63f250..0a669476 100644 --- a/djpeg.c +++ b/djpeg.c @@ -165,6 +165,7 @@ usage (void) #endif fprintf(stderr, " -verbose or -debug Emit debug output\n"); + fprintf(stderr, " -version Print version information and exit\n"); exit(EXIT_FAILURE); } @@ -261,6 +262,11 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, } cinfo->err->trace_level++; + } else if (keymatch(arg, "version", 4)) { + fprintf(stderr, "%s version %s (build %s)\n", + PACKAGE_NAME, VERSION, BUILD); + exit(EXIT_SUCCESS); + } else if (keymatch(arg, "fast", 1)) { /* Select recommended processing options for quick-and-dirty output. */ cinfo->two_pass_quantize = FALSE; diff --git a/jpegtran.1 b/jpegtran.1 index b6a3e566..5b8e1263 100644 --- a/jpegtran.1 +++ b/jpegtran.1 @@ -1,4 +1,4 @@ -.TH JPEGTRAN 1 "1 January 2013" +.TH JPEGTRAN 1 "21 November 2014" .SH NAME jpegtran \- lossless transformation of JPEG files .SH SYNOPSIS @@ -214,6 +214,9 @@ give more output. Also, version information is printed at startup. .B \-debug Same as .BR \-verbose . +.TP +.B \-version +Print version information and exit. .SH EXAMPLES .LP This example converts a baseline JPEG file to progressive form: diff --git a/jpegtran.c b/jpegtran.c index 6b40de39..e4024cbb 100644 --- a/jpegtran.c +++ b/jpegtran.c @@ -4,7 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1995-2010, Thomas G. Lane, Guido Vollbeding. * libjpeg-turbo Modifications: - * Copyright (C) 2010, D. R. Commander. + * Copyright (C) 2010, 2014, D. R. Commander. * For conditions of distribution and use, see the accompanying README file. * * This file contains a command-line user interface for JPEG transcoding. @@ -86,6 +86,7 @@ usage (void) fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n"); fprintf(stderr, " -outfile name Specify name for output file\n"); fprintf(stderr, " -verbose or -debug Emit debug output\n"); + fprintf(stderr, " -version Print version information and exit\n"); fprintf(stderr, "Switches for wizards:\n"); #ifdef C_MULTISCAN_FILES_SUPPORTED fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n"); @@ -212,6 +213,11 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, } cinfo->err->trace_level++; + } else if (keymatch(arg, "version", 4)) { + fprintf(stderr, "%s version %s (build %s)\n", + PACKAGE_NAME, VERSION, BUILD); + exit(EXIT_SUCCESS); + } else if (keymatch(arg, "flip", 1)) { /* Mirror left-right or top-bottom. */ if (++argn >= argc) /* advance to next argument */