diff options
author | 2017-01-25 17:49:53 +0100 | |
---|---|---|
committer | 2017-01-25 17:49:53 +0100 | |
commit | 78a7342750182687a08060c5e060cb897800e9f6 (patch) | |
tree | 73ab5b3a3b09c56a73a74950a71701adf7a22cc7 /3rdparty/libjpeg/jpegtran.c | |
parent | 93c92be81517a982ef9b47eed610a3e42ed244bc (diff) |
updated libjpeg to 9c (nw)
Diffstat (limited to '3rdparty/libjpeg/jpegtran.c')
-rw-r--r-- | 3rdparty/libjpeg/jpegtran.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/3rdparty/libjpeg/jpegtran.c b/3rdparty/libjpeg/jpegtran.c index 8cb3d807fbb..5269344e171 100644 --- a/3rdparty/libjpeg/jpegtran.c +++ b/3rdparty/libjpeg/jpegtran.c @@ -1,7 +1,7 @@ /* * jpegtran.c * - * Copyright (C) 1995-2010, Thomas G. Lane, Guido Vollbeding. + * Copyright (C) 1995-2013, Thomas G. Lane, Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -66,8 +66,8 @@ usage (void) fprintf(stderr, "Switches for modifying the image:\n"); #if TRANSFORMS_SUPPORTED fprintf(stderr, " -crop WxH+X+Y Crop to a rectangular subarea\n"); - fprintf(stderr, " -grayscale Reduce to grayscale (omit color data)\n"); fprintf(stderr, " -flip [horizontal|vertical] Mirror image (left-right or top-bottom)\n"); + fprintf(stderr, " -grayscale Reduce to grayscale (omit color data)\n"); fprintf(stderr, " -perfect Fail if there is non-transformable edge blocks\n"); fprintf(stderr, " -rotate [90|180|270] Rotate image (degrees clockwise)\n"); #endif @@ -76,16 +76,17 @@ usage (void) fprintf(stderr, " -transpose Transpose image\n"); fprintf(stderr, " -transverse Transverse transpose image\n"); fprintf(stderr, " -trim Drop non-transformable edge blocks\n"); + fprintf(stderr, " -wipe WxH+X+Y Wipe (gray out) a rectangular subarea\n"); #endif fprintf(stderr, "Switches for advanced users:\n"); +#ifdef C_ARITH_CODING_SUPPORTED + fprintf(stderr, " -arithmetic Use arithmetic coding\n"); +#endif fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n"); 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, "Switches for wizards:\n"); -#ifdef C_ARITH_CODING_SUPPORTED - fprintf(stderr, " -arithmetic Use arithmetic coding\n"); -#endif #ifdef C_MULTISCAN_FILES_SUPPORTED fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n"); #endif @@ -187,7 +188,8 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, #if TRANSFORMS_SUPPORTED if (++argn >= argc) /* advance to next argument */ usage(); - if (! jtransform_parse_crop_spec(&transformoption, argv[argn])) { + if (transformoption.crop /* reject multiple crop/wipe requests */ || + ! jtransform_parse_crop_spec(&transformoption, argv[argn])) { fprintf(stderr, "%s: bogus -crop argument '%s'\n", progname, argv[argn]); exit(EXIT_FAILURE); @@ -336,6 +338,21 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, /* Trim off any partial edge MCUs that the transform can't handle. */ transformoption.trim = TRUE; + } else if (keymatch(arg, "wipe", 1)) { +#if TRANSFORMS_SUPPORTED + if (++argn >= argc) /* advance to next argument */ + usage(); + if (transformoption.crop /* reject multiple crop/wipe requests */ || + ! jtransform_parse_crop_spec(&transformoption, argv[argn])) { + fprintf(stderr, "%s: bogus -wipe argument '%s'\n", + progname, argv[argn]); + exit(EXIT_FAILURE); + } + select_transform(JXFORM_WIPE); +#else + select_transform(JXFORM_NONE); /* force an error */ +#endif + } else { usage(); /* bogus switch */ } @@ -467,7 +484,7 @@ main (int argc, char **argv) /* Adjust default decompression parameters */ if (scaleoption != NULL) - if (sscanf(scaleoption, "%d/%d", + if (sscanf(scaleoption, "%u/%u", &srcinfo.scale_num, &srcinfo.scale_denom) < 1) usage(); |