From a33831e21a3e09441974f5b6da92ad136cb8bdc8 Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 12 Dec 2013 20:20:08 -0800 Subject: [PATCH 1/4] dwebp: let -- stop parameter parsing this enables dwebp to accept input files starting with '-' Change-Id: I1e2c9c7bc2963d77be039c99e72f744560f0b0a2 --- examples/dwebp.c | 3 +++ man/dwebp.1 | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/dwebp.c b/examples/dwebp.c index 5a2c0b65..fca9c9a7 100644 --- a/examples/dwebp.c +++ b/examples/dwebp.c @@ -649,6 +649,9 @@ int main(int argc, const char *argv[]) { #endif } else if (!strcmp(argv[c], "-incremental")) { incremental = 1; + } else if (!strcmp(argv[c], "--")) { + if (c < argc - 1) in_file = argv[++c]; + break; } else if (argv[c][0] == '-') { fprintf(stderr, "Unknown option '%s'\n", argv[c]); Help(); diff --git a/man/dwebp.1 b/man/dwebp.1 index 9a616763..36bbf0c9 100644 --- a/man/dwebp.1 +++ b/man/dwebp.1 @@ -1,5 +1,5 @@ .\" Hey, EMACS: -*- nroff -*- -.TH DWEBP 1 "November 26, 2013" +.TH DWEBP 1 "December 12, 2013" .SH NAME dwebp \- decompress a WebP file to an image file .SH SYNOPSIS @@ -99,6 +99,8 @@ http://www.webmproject.org/code/contribute/submitting-patches/ dwebp picture.webp \-o output.png .br dwebp picture.webp \-ppm \-o output.ppm +.br +dwebp \-o output.ppm \-\- \-\-\-picture.webp .SH AUTHORS \fBdwebp\fP was written by the WebP team. From 98af68fe26e1bcba9c29f5f3fa2ae4ba9cace339 Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 12 Dec 2013 20:20:08 -0800 Subject: [PATCH 2/4] cwebp: let -- stop parameter parsing this enables cwebp to accept input files starting with '-' Change-Id: I13b506886c3df8a4e8fb350f3d365eaf7e072a4a --- examples/cwebp.c | 3 +++ man/cwebp.1 | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/cwebp.c b/examples/cwebp.c index 0fa83d1e..2d1f076d 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -895,6 +895,9 @@ int main(int argc, const char *argv[]) { #endif } else if (!strcmp(argv[c], "-v")) { verbose = 1; + } else if (!strcmp(argv[c], "--")) { + if (c < argc - 1) in_file = argv[++c]; + break; } else if (argv[c][0] == '-') { fprintf(stderr, "Error! Unknown option '%s'\n", argv[c]); HelpLong(); diff --git a/man/cwebp.1 b/man/cwebp.1 index 9ac40311..f2a9b8bb 100644 --- a/man/cwebp.1 +++ b/man/cwebp.1 @@ -1,5 +1,5 @@ .\" Hey, EMACS: -*- nroff -*- -.TH CWEBP 1 "October 23, 2013" +.TH CWEBP 1 "December 12, 2013" .SH NAME cwebp \- compress an image file to a WebP file .SH SYNOPSIS @@ -255,6 +255,8 @@ cwebp \-q 50 -lossless picture.png \-o picture_lossless.webp cwebp \-q 70 picture_with_alpha.png \-o picture_with_alpha.webp .br cwebp \-sns 70 \-f 50 \-size 60000 picture.png \-o picture.webp +.br +cwebp \-o picture.webp \-\- \-\-\-picture.png .SH AUTHORS \fBcwebp\fP was written by the WebP team. From a4b0aa06ee41571da82082b6d4bb8ee7a624502c Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 12 Dec 2013 20:20:08 -0800 Subject: [PATCH 3/4] vwebp: let -- stop parameter parsing this enables vwebp to accept input files starting with '-' Change-Id: I8467bb719ba745b2aa14a5c5ce2ff392cd9601d5 --- examples/vwebp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/vwebp.c b/examples/vwebp.c index da08135e..1679132c 100644 --- a/examples/vwebp.c +++ b/examples/vwebp.c @@ -425,6 +425,9 @@ int main(int argc, char *argv[]) { return 0; } else if (!strcmp(argv[c], "-mt")) { config->options.use_threads = 1; + } else if (!strcmp(argv[c], "--")) { + if (c < argc - 1) kParams.file_name = argv[++c]; + break; } else if (argv[c][0] == '-') { printf("Unknown option '%s'\n", argv[c]); Help(); From 5459030be02ce2ea78978060f8a4f8eaf2a0ae45 Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 12 Dec 2013 20:20:08 -0800 Subject: [PATCH 4/4] gif2webp: let -- stop parameter parsing this enables gif2webp to accept input files starting with '-' Change-Id: I994a5587e16e3af83ca45bfda8caf2dc39068b6c --- examples/gif2webp.c | 3 +++ man/gif2webp.1 | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/gif2webp.c b/examples/gif2webp.c index 6e8d79ee..6c7f4638 100644 --- a/examples/gif2webp.c +++ b/examples/gif2webp.c @@ -359,6 +359,9 @@ int main(int argc, const char *argv[]) { quiet = 1; } else if (!strcmp(argv[c], "-v")) { verbose = 1; + } else if (!strcmp(argv[c], "--")) { + if (c < argc - 1) in_file = argv[++c]; + break; } else if (argv[c][0] == '-') { fprintf(stderr, "Error! Unknown option '%s'\n", argv[c]); Help(); diff --git a/man/gif2webp.1 b/man/gif2webp.1 index 6fb79b7b..ded05e37 100644 --- a/man/gif2webp.1 +++ b/man/gif2webp.1 @@ -1,5 +1,5 @@ .\" Hey, EMACS: -*- nroff -*- -.TH GIF2WEBP 1 "November 18, 2013" +.TH GIF2WEBP 1 "December 12, 2013" .SH NAME gif2webp \- Convert a GIF image to WebP .SH SYNOPSIS @@ -119,6 +119,8 @@ gif2webp \-q 70 picture.gif \-o picture.webp gif2webp \-lossy \-m 3 picture.gif \-o picture_lossy.webp .br gif2webp \-lossy \-f 50 picture.gif \-o picture.webp +.br +gif2webp \-q 70 \-o picture.webp \-\- \-\-\-picture.gif .SH AUTHORS \fBgif2webp\fP was written by the WebP team.