From b7fb0ed5679b571d2067c7b59ca6be1f5b42bf73 Mon Sep 17 00:00:00 2001 From: Vikas Arora Date: Wed, 20 Jun 2012 09:02:25 +0530 Subject: [PATCH] Log warning for unsupported options for lossless. Change-Id: I30d4e775959c7a4a8f5b649c8c90a4edb8cced47 --- examples/cwebp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/examples/cwebp.c b/examples/cwebp.c index 7fda7f4d..4c5af54b 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -959,6 +959,23 @@ int main(int argc, const char *argv[]) { goto Error; } + // Check for unsupported command line options for lossless mode and log + // warning for such options. + if (config.lossless == 1) { + if (config.target_size > 0 || config.target_PSNR > 0) { + fprintf(stderr, "Encoding for specified size or PSNR is not supported" + " for lossless encoding. Ignoring such option(s)!\n"); + } + if (config.partition_limit > 0) { + fprintf(stderr, "Partition limit option is not required for lossless" + " encoding. Ignoring this option!\n"); + } + if (show_progress) { + fprintf(stderr, "Progress reporting option is not supported for lossless" + " encoding. Ignoring this option!\n"); + } + } + if (!WebPValidateConfig(&config)) { fprintf(stderr, "Error! Invalid configuration.\n"); goto Error;