fix issue #3092 - skip removing colormap

This commit is contained in:
zdenop 2022-06-23 16:38:32 +02:00
parent 27b1827ccd
commit 18fb5aa977

View File

@ -170,16 +170,7 @@ void ImageThresholder::SetImage(const Image pix) {
// Convert the image as necessary so it is one of binary, plain RGB, or
// 8 bit with no colormap. Guarantee that we always end up with our own copy,
// not just a clone of the input.
if (pixGetColormap(src)) {
Image tmp = pixRemoveColormap(src, REMOVE_CMAP_BASED_ON_SRC);
depth = pixGetDepth(tmp);
if (depth > 1 && depth < 8) {
pix_ = pixConvertTo8(tmp, false);
tmp.destroy();
} else {
pix_ = tmp;
}
} else if (depth > 1 && depth < 8) {
if (depth > 1 && depth < 8) {
pix_ = pixConvertTo8(src, false);
} else {
pix_ = src.copy();