shithub: jbig2

Download patch

ref: f1df2a053c81e3f57280a59f917c62edc90b639b
parent: ec60c3ff44b9f8e48a15a568de3ba7014adeb2d7
author: Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
date: Sun Jan 27 09:06:05 EST 2013

Bug 691246: Handle inverted symbol region.

Propagate combination operator and also fix an error in coding XNOR
logical operation.

--- a/jbig2_generic.c
+++ b/jbig2_generic.c
@@ -861,7 +861,7 @@
     }
 
   jbig2_page_add_result(ctx, &ctx->pages[ctx->current_page],
-			image, rsi.x, rsi.y, JBIG2_COMPOSE_OR);
+			image, rsi.x, rsi.y, rsi.op);
 
 cleanup:
   jbig2_free(ctx->allocator, as);
--- a/jbig2_image.c
+++ b/jbig2_image.c
@@ -185,7 +185,7 @@
 	    for (j = 0; j < sh; j++) {
 		for (i = 0; i < sw; i++) {
 		    jbig2_image_set_pixel(dst, i+x, j+y,
-			~(jbig2_image_get_pixel(src, i+sx, j+sy) ^
+			(jbig2_image_get_pixel(src, i+sx, j+sy) ==
 			jbig2_image_get_pixel(dst, i+x, j+y)));
 		}
     	    }
--- a/jbig2_page.c
+++ b/jbig2_page.c
@@ -285,7 +285,7 @@
     }
 
     jbig2_image_compose(ctx, page->image, image,
-                        x, y + page->end_row, JBIG2_COMPOSE_OR);
+                        x, y + page->end_row, op);
 
     return 0;
 }