Skip to content

Commit

Permalink
Fix regression (broken unit tests)
Browse files Browse the repository at this point in the history
Fixes: 95019a8 ("fix issue #3940 - remove colormap before thresholding")
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Oct 24, 2022
1 parent 1ae0ec9 commit 23613c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ccmain/thresholder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ bool ImageThresholder::ThresholdToPix(Image *pix) {
// allows the caller to modify the output.
*pix = original.copy();
} else {
Image tmp;
if (pixGetColormap(original)) {
Image tmp;
Image without_cmap =
pixRemoveColormap(original, REMOVE_CMAP_BASED_ON_SRC);
int depth = pixGetDepth(without_cmap);
Expand All @@ -304,9 +304,11 @@ bool ImageThresholder::ThresholdToPix(Image *pix) {
tmp = without_cmap.copy();
}
without_cmap.destroy();
OtsuThresholdRectToPix(tmp, pix);
tmp.destroy();
} else {
OtsuThresholdRectToPix(pix_, pix);
}
OtsuThresholdRectToPix(tmp, pix);
tmp.destroy();
}
original.destroy();
return true;
Expand Down

0 comments on commit 23613c5

Please sign in to comment.