#1082830 unpaper: (data loss) Half the content is lost when the source data is 600 dpi

Package:
unpaper
Source:
unpaper
Description:
post-processing tool for scanned pages
Submitter:
Manny
Date:
2024-12-27 10:33:02 UTC
Severity:
normal
Tags:
#1082830#5
Date:
2024-09-27 08:03:19 UTC
From:
To:
When the input file is 600 dpi, the leftmost 25% and rightmost 25% of
the content is truncated. Only the middle 50% survives unpaper. My
command was simply:

  $ unpaper -t pbm source.pgm target.pbm

I also tried adding --dpi 600, which had no effect.

This defect has already been reported upstream. This bug report is
filed to indicate that version 7.0.0-0.1 of the debian pkg is
affected. This is also to add information, as the original bug report
demonstrates the problem with TIFF files, while my experience shows
that the bug also manifests in a PGM→PBM conversion.

#1082830#12
Date:
2024-09-27 20:10:04 UTC
From:
To:
DPI page. Then fed that into unpaper. There was no data loss.

So apparently the unpaper bug manifests when an image is more than
~2550 pixels wide.

#1082830#17
Date:
2024-12-27 10:29:58 UTC
From:
To:
The defect is very reproduceable when the width well exceeds 2550
pixels. However, even when an image is normal (2550 pixels wide a4,
300dpi), it sometimes still truncates ⅓ of the image.

The following two images went through the same processing prior to
feeding to unpaper:

===8<----------------------------------------
$ identify broken.pgm workng.pgm
broken.pgm PGM 2550x3508 2550x3508+0+0 8-bit Grayscale Gray 8.53101MiB 0.030u 0:00.042
workng.pgm PGM 2550x3508 2550x3508+0+0 8-bit Grayscale Gray 8.53101MiB 0.040u 0:00.122
===8<----------------------------------------

The images have the same geometry. Yet broken.pgm lost a chunck of
content and workng.pgm had no issue. So images >2550 pixels wide are
reproduceable but images at 2550 pixels wide are unpredictably broken.