diff --git a/backend/genesys_conv.c b/backend/genesys_conv.c index 7a4873f80..779355f5c 100644 --- a/backend/genesys_conv.c +++ b/backend/genesys_conv.c @@ -122,6 +122,11 @@ binarize_line(Genesys_Device * dev, uint8_t *src, uint8_t *dst, int width) min = src[x]; } } + /* safeguard againt dark of white areas */ + if(min>80) + min=0; + if(max<80) + max=255; for (x = 0; x < width; x++) { src[x] = ((src[x] - min) * 255) / (max - min);