Fix reversing an image with an empty -c/--colors spec file (#2228)

This commit is contained in:
Rangi authored and GitHub committed 2026-10-22 15:30:43 -04:00
1 parent b99069e25d
commit 1e9e2ad5fa
5 files changed
+15

No files matched your search

+12
View File
@@ -288,6 +288,18 @@ void reverse() {
grayscale = true;
} else if (options.hasExplicitPalSpec()) {
palettes = std::move(options.palSpec); // We won't be using it again.
if (palettes.empty()) {
fatal("Specified 0 palettes");
}
if (palettes.size() > options.nbPalettes) {
warnx(
"Specified %zu palettes, more than the specified limit of %" PRIu16,
palettes.size(),
options.nbPalettes
);
}
} else {
grayscale = true;
}