diff --git a/ChangeLog.txt b/ChangeLog.txt index 6b71ac2a..9fa884a4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -13,6 +13,9 @@ instead of -1 if componentID was > 0 and subsamp was TJSAMP_GRAY. [3] Fixed an issue in tjBufSizeYUV2() wherby it would erroneously return 0 instead of -1 if width was < 1. +[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 c6ea0910..76707d3c 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. * mozjpeg Modifications: * Copyright (C) 2014, Mozilla Corporation. * For conditions of distribution and use, see the accompanying README file. @@ -214,6 +214,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, " -qtables file Use quantization tables given in file\n"); fprintf(stderr, " -qslots N[,...] Set component quantization tables\n"); @@ -324,6 +325,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, "fastcrush", 4)) { jpeg_c_set_bool_param(cinfo, JBOOLEAN_OPTIMIZE_SCANS, FALSE); 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..8ddff96e 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 926c2774..782c4732 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. * mozjpeg Modifications: * Copyright (C) 2014, Mozilla Corporation. * For conditions of distribution and use, see the accompanying README file. @@ -92,6 +92,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"); @@ -222,6 +223,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 */