Allow rgbgfx to generate a palette from a spec, without an image (#1192)

This commit is contained in:
Rangi
2023-11-02 15:12:48 -04:00
committed by GitHub
parent 0d72ba886b
commit 5a25c547ab
4 changed files with 83 additions and 59 deletions

View File

@@ -766,21 +766,24 @@ int main(int argc, char *argv[]) {
fputs("Ready.\n", stderr);
}
if (options.input.empty()) {
fputs("FATAL: No input image specified\n", stderr);
printUsage();
exit(1);
}
// Do not do anything if option parsing went wrong
if (nbErrors) {
giveUp();
}
if (options.reverse()) {
reverse();
if (!options.input.empty()) {
if (options.reverse()) {
reverse();
} else {
process();
}
} else if (!options.palettes.empty() && options.palSpecType == Options::EXPLICIT
&& !options.reverse()) {
processPalettes();
} else {
process();
fputs("FATAL: No input image specified\n", stderr);
printUsage();
exit(1);
}
if (nbErrors) {