]> granicus.if.org Git - libjpeg-turbo/commitdiff
Print the library version and exit whenever -version is passed to cjpeg, djpeg, or...
authorDRC <dcommander@users.sourceforge.net>
Sat, 22 Nov 2014 04:04:38 +0000 (04:04 +0000)
committerDRC <dcommander@users.sourceforge.net>
Sat, 22 Nov 2014 04:04:38 +0000 (04:04 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.4.x@1422 632fc199-4ca6-4c93-a231-07263d6284db

ChangeLog.txt
cjpeg.1
cjpeg.c
djpeg.1
djpeg.c
jpegtran.1
jpegtran.c

index e21ef968c42b7815570f87d220a35d8750180977..f0d126b40e79073190174b7e7e67c84a47f163ce 100644 (file)
@@ -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 5f5090cfcc34cc80ec641b5733affc156d091ce7..e338c80c15de2fe1a7690bf73eeb968925242036 100644 (file)
--- 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 a7d25047a0c6762f64c4931be9e12d0b1634c70c..af946d28d77a62bd93354e5d93dcef230687727d 100644 (file)
--- 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 9b040ae996856b356626547658cf2a6411a3598f..73d05148ab470b9709452887cfe4bdd48b5dbd71 100644 (file)
--- 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 7c63f250163bac2a37ff26327d7f889b74e7fcd9..0a669476172bceb8f0a1f2ac12959a7d2c9def48 100644 (file)
--- 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;
index b6a3e56650b456973dfd92b0af915af97f89cc0f..5b8e1263a81b56848997d7899a9cc4d92375e0cf 100644 (file)
@@ -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:
index 6b40de39b7f1335f9aa621f2de290d4f7e57dfac..e4024cbb00c4f67216d552595ae380727f4960cb 100644 (file)
@@ -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 */