diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-03-23 21:45:21 -0400 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-03-23 21:45:21 -0400 |
commit | 839bb4616f13171a23ad7937bf57d0a01d61d42a (patch) | |
tree | 01de78a5ce973b9fb7ac0f9216d64f736f8e163d /gnu/packages/patches/ccextractor-fix-ocr.patch | |
parent | 0357bbbcd850f9220078a62da3c30358b8983765 (diff) | |
parent | ef71e3290916583973724316e815cee840c1b6d8 (diff) |
Merge remote-tracking branch 'origin/master' into staging.
With resolved conflicts in:
gnu/packages/ibus.scm
gnu/packages/image.scm
gnu/packages/lisp.scm
gnu/packages/virtualization.scm
Diffstat (limited to 'gnu/packages/patches/ccextractor-fix-ocr.patch')
-rw-r--r-- | gnu/packages/patches/ccextractor-fix-ocr.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gnu/packages/patches/ccextractor-fix-ocr.patch b/gnu/packages/patches/ccextractor-fix-ocr.patch new file mode 100644 index 0000000000..9a06026724 --- /dev/null +++ b/gnu/packages/patches/ccextractor-fix-ocr.patch @@ -0,0 +1,29 @@ +Extracted from upstream commit 0264e7da2be67182deb031228eb07e6ed4943c81. + +diff --git a/src/lib_ccx/ocr.c b/src/lib_ccx/ocr.c +index 31cc1c5c..73bd4818 100644 +--- a/src/lib_ccx/ocr.c ++++ b/src/lib_ccx/ocr.c +@@ -331,6 +331,11 @@ char *ocr_bitmap(void *arg, png_color *palette, png_byte *alpha, unsigned char * + } + + BOX *crop_points = ignore_alpha_at_edge(copy->alpha, copy->data, w, h, color_pix, &color_pix_out); ++ ++ l_int32 x, y, _w, _h; ++ ++ boxGetGeometry(crop_points, &x, &y, &_w, &_h); ++ + // Converting image to grayscale for OCR to avoid issues with transparency + cpix_gs = pixConvertRGBToGray(cpix, 0.0, 0.0, 0.0); + +@@ -426,8 +431,8 @@ char *ocr_bitmap(void *arg, png_color *palette, png_byte *alpha, unsigned char * + { + for (int j = x1; j <= x2; j++) + { +- if (copy->data[(crop_points->y + i) * w + (crop_points->x + j)] != firstpixel) +- histogram[copy->data[(crop_points->y + i) * w + (crop_points->x + j)]]++; ++ if (copy->data[(y + i) * w + (x + j)] != firstpixel) ++ histogram[copy->data[(y + i) * w + (x + j)]]++; + } + } + /* sorted in increasing order of intensity */ |