Skip to content

Commit

Permalink
fix issue #3092 - skip removing colormap
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Jun 23, 2022
1 parent 27b1827 commit 18fb5aa
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/ccmain/thresholder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 18fb5aa

Please sign in to comment.