diff --git a/examples/img2webp.c b/examples/img2webp.c index 9cfccb43..97d2669e 100644 --- a/examples/img2webp.c +++ b/examples/img2webp.c @@ -151,6 +151,7 @@ int main(int argc, const char* argv[]) { WebPData webp_data; int c; int have_input = 0; + int last_input_index = 0; CommandLineArguments cmd_args; int ok; @@ -279,6 +280,7 @@ int main(int argc, const char* argv[]) { // read next input image pic.use_argb = 1; ok = ReadImage((const char*)GET_WARGV_SHIFTED(argv, c), &pic); + last_input_index = c; if (!ok) goto End; if (enc == NULL) { @@ -317,6 +319,13 @@ int main(int argc, const char* argv[]) { ++pic_num; } + for (c = last_input_index + 1; c < argc; ++c) { + if (argv[c] != NULL) { + fprintf(stderr, "Warning: unused option [%s]!" + " Frame options go before the input frame.\n", argv[c]); + } + } + // add a last fake frame to signal the last duration ok = ok && WebPAnimEncoderAdd(enc, NULL, timestamp_ms, NULL); ok = ok && WebPAnimEncoderAssemble(enc, &webp_data);