Make dwebp listen more to the -quiet flag

it was still printing "Saved file ...".

Change-Id: Ie450535d9d54b4ac213e486ab7f3c50761fefe2a
This commit is contained in:
Lode Vandevenne 2015-11-20 10:35:03 +00:00 committed by James Zern
parent b37b0179c5
commit f240117bef

View File

@ -44,6 +44,7 @@
#include "./stopwatch.h" #include "./stopwatch.h"
static int verbose = 0; static int verbose = 0;
static int quiet = 0;
#ifndef WEBP_DLL #ifndef WEBP_DLL
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -509,11 +510,13 @@ static int SaveOutput(const WebPDecBuffer* const buffer,
fclose(fout); fclose(fout);
} }
if (ok) { if (ok) {
if (!quiet) {
if (use_stdout) { if (use_stdout) {
fprintf(stderr, "Saved to stdout\n"); fprintf(stderr, "Saved to stdout\n");
} else { } else {
fprintf(stderr, "Saved file %s\n", out_file); fprintf(stderr, "Saved file %s\n", out_file);
} }
}
if (verbose) { if (verbose) {
const double write_time = StopwatchReadAndReset(&stop_watch); const double write_time = StopwatchReadAndReset(&stop_watch);
fprintf(stderr, "Time to write output: %.3fs\n", write_time); fprintf(stderr, "Time to write output: %.3fs\n", write_time);
@ -570,7 +573,6 @@ int main(int argc, const char *argv[]) {
int ok = 0; int ok = 0;
const char *in_file = NULL; const char *in_file = NULL;
const char *out_file = NULL; const char *out_file = NULL;
int quiet = 0;
WebPDecoderConfig config; WebPDecoderConfig config;
WebPDecBuffer* const output_buffer = &config.output; WebPDecBuffer* const output_buffer = &config.output;