--- unpaper/src/unpaper.c~ 2006-05-09 05:15:12.000000000 +0300 +++ unpaper/src/unpaper.c 2006-06-12 17:26:24.000000000 +0300 @@ -2931,6 +3137,9 @@ untilX = ((horizontal==TRUE)&&(vertical==FALSE)) ? ((image->width - 1) >> 1) : image->width - 1; // w>>1 == (int)(w-0.5)/2 untilY = (vertical==TRUE) ? ((image->height - 1) >> 1) : image->height - 1; for (y = 0; y <= untilY; y++) { + if (y == untilY && (image->height & 1) != 0 && horizontal == TRUE && vertical == TRUE) { + untilX = (image->width - 1) >> 1; + } for (x = 0; x <= untilX; x++) { xx = (horizontal==TRUE) ? image->width - x - 1 : x; yy = (vertical==TRUE) ? image->height - y - 1 : y;