unpaper truncates some images
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
unpaper (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
An envelope was scanned sideways to a PNG file, in grayscale. Imagemagick "convert" was used to produce a PGM file. Then unpaper was used to rotate it and bilevel it. This often works fine with no issues, but exceptionally for one image in particular, unpaper cuts a box out of the center of the image and shifts over the return address side of the envelope, ultimately causing corruption. This is the command used:
$ unpaper -v -t pbm -b 0.2 --pre-rotate 90 sample.pgm sample_b20.pbm
output was:
-------
Processing sheet #1: sample.pgm -> sample_b20.pbm
pre-rotating 90 degrees.
input-file for sheet 1: sample.pgm
output-file for sheet 1: sample_b20.pbm
sheet size: 2747x1156
...
noise-filter ... deleted 20062 clusters.
blur-filter... deleted 387 pixels.
auto-masking (1373,578): 0,0,2746,1155 (invalid detection, using full page size)
gray-filter... deleted 13774552 pixels.
auto-masking (1373,578): -7,0,1458,1155
detected rotation left: [-7,0,1458,1155]: 0.003491
detected rotation right: [-7,0,1458,1155]: -0.054105
rotation average: -0.025307 deviation: 0.040726 rotation-
out of deviation range - NO ROTATING
rotate (1373,578): 0.000000
auto-masking (1373,578): -7,0,1458,1155
centering mask [-7,0,1458,1155] (1373,578): 647, 0
border detected: (0,25,1,21) in [0,0,2746,1155]
aligning mask [0,25,2745,1134] (0,22): 0, -3
writing output.
[image2 @ 0x561e104d1540] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[image2 @ 0x561e104d1540] Encoder did not produce proper pts, making some up.
-------
The input file is attached.
It's easy to see the problem by noticing the postmark date on the input image, then seeing that the month and day are missing from the resulting image.
This comment attaches the output file showing the missing postmark date.