mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-12 22:14:29 +02:00
force "-pass 6" if -psnr or -size is used but -pass isn't.
This is to prevent users shooting in the foot using -psnr or -size alone and not getting the expected result. Change-Id: I67a3289e4ec0a2a813c98807f2ec5e600f52dc63
This commit is contained in:
@ -972,6 +972,11 @@ int main(int argc, const char *argv[]) {
|
||||
" encoding. Ignoring this option!\n");
|
||||
}
|
||||
}
|
||||
// If a target size or PSNR was given, but somehow the -pass option was
|
||||
// omitted, force a reasonable value.
|
||||
if (config.target_size > 0 || config.target_PSNR > 0) {
|
||||
if (config.pass == 1) config.pass = 6;
|
||||
}
|
||||
|
||||
if (!WebPValidateConfig(&config)) {
|
||||
fprintf(stderr, "Error! Invalid configuration.\n");
|
||||
|
Reference in New Issue
Block a user