Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#985887: gscan2pdf: saves b&w scanned pages in inverted mode

26 views
Skip to first unread message

Francesco Potortì

unread,
Mar 25, 2021, 8:00:03 AM3/25/21
to
Package: gscan2pdf
Version: 2.11.0-1
Severity: normal
X-Debbugs-Cc: none, Francesco Potortì <Pot...@isti.cnr.it>

This looks exactly like a bug that was fixed back in 2016:
https://bugzilla.redhat.com/show_bug.cgi?id=1369984

In short, the problem occurs only with pages scanned in Grey mode. When
the document is saved, the pdf document that is created has those pages
in inverted mode, that is black is exchanged with white.

--
Francesco Potortì (ricercatore) Voice: +39.050.621.3058
ISTI - Area della ricerca CNR Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa Skype: wnlabisti
(gate 20, 1st floor, room C71) Web: http://fly.isti.cnr.it


-- System Information:
Debian Release: bullseye/sid
APT prefers testing
APT policy: (990, 'testing'), (101, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-3-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gscan2pdf depends on:
ii imagemagick 8:6.9.11.60+dfsg-1
ii imagemagick-6.q16 [imagemagick] 8:6.9.11.60+dfsg-1
ii libconfig-general-perl 2.63-1
ii libdate-calc-perl 6.4-1.1
ii libfilesys-df-perl 0.92-6+b6
ii libgoocanvas2-perl 0.06-2
ii libgtk3-imageview-perl 6-1
ii libgtk3-perl 0.038-1
ii libgtk3-simplelist-perl 0.21-1
ii libhtml-parser-perl 3.75-1+b1
ii libimage-magick-perl 8:6.9.11.60+dfsg-1
ii libimage-sane-perl 5-1+b1
ii liblist-moreutils-perl 0.430-2
ii liblocale-codes-perl 3.66-1
ii liblocale-gettext-perl 1.07-4+b1
ii liblog-log4perl-perl 1.54-1
ii libossp-uuid-perl [libdata-uuid-perl] 1.6.2-1.5+b9
ii libpdf-builder-perl 3.021-1
ii libproc-processtable-perl 0.59-2+b1
ii libreadonly-perl 2.050-3
ii librsvg2-common 2.50.3+dfsg-1
ii libset-intspan-perl 1.19-1.1
ii libtiff-tools 4.2.0-1
ii libtry-tiny-perl 0.30-1
ii sane-utils 1.0.31-4

Versions of packages gscan2pdf recommends:
ii djvulibre-bin 3.5.28-1
ii gocr 0.52-3
ii pdftk 2.02-5+b1
ii pdftk-java [pdftk] 3.2.2-1
ii tesseract-ocr 4.1.1-2.1
ii unpaper 6.1-2+b2
ii xdg-utils 1.1.3-4

gscan2pdf suggests no packages.

-- no debconf information

Jeff

unread,
Mar 25, 2021, 1:50:03 PM3/25/21
to
Thanks for the report.

Please start gscan2pdf from the command line:

gscan2pdf --log=log

reproduce the problem, quit, and post the input image, log file and the
resulting PDF.

OpenPGP_signature

Francesco Potortì

unread,
Mar 26, 2021, 7:10:03 PM3/26/21
to
>Please start gscan2pdf from the command line:
>
> gscan2pdf --log=log
>
>reproduce the problem, quit, and post the input image, log file and the
>resulting PDF.

I scanned the same a4 sheet twice, first in color mode, then in bw
mode. The two scans appear ok in the gscan2pdf windows. However, the
resulting pdf has the second page in inverted mode.

After exiting anf closing th elog, gsca2pdf dumped a 508MB core.

You find the log and the pdf at
http://fly.isti.cnr.it/tmp/gscan2pdf

Jeff

unread,
Mar 27, 2021, 8:50:03 AM3/27/21
to
Thanks for the log file. You seem to have selected compression=none
(which resulted in a REALLY big PDF). Was that deliberate? Please try
compression=Auto.

This seems to be a bug in PDF::Builder (libpdf-builder-perl). I'll see
if I can work up a patch.

OpenPGP_signature

Francesco Potortì

unread,
Mar 27, 2021, 9:10:02 AM3/27/21
to
>Thanks for the log file. You seem to have selected compression=none
>(which resulted in a REALLY big PDF). Was that deliberate? Please try
>compression=Auto.

That's because I have written my own compression script using
ghostscript and use it as post-processing tool (which I disabled when
sending the report). It seems to do a better job at compressing than
almost all tools out there. I have it at:
http://fly.isti.cnr.it/pub/software/unix/pdfcompress

>This seems to be a bug in PDF::Builder (libpdf-builder-perl). I'll see
>if I can work up a patch.

Thanks!

Jeff

unread,
Mar 27, 2021, 2:10:03 PM3/27/21
to
On 27/03/2021 13:58, Francesco Potortì wrote:
> That's because I have written my own compression script using
> ghostscript and use it as post-processing tool (which I disabled when
> sending the report). It seems to do a better job at compressing than
> almost all tools out there. I have it at:
> http://fly.isti.cnr.it/pub/software/unix/pdfcompress

Nonetheless. I think the bug was triggered by the compression chosen.
Please try compression=Auto to compression=Flate, which I think should
work around the problem.

OpenPGP_signature

Jeff

unread,
Mar 28, 2021, 7:00:03 AM3/28/21
to
tags 985887 patch
thanks


I've cherry-picked enough of this patch to fix this from master at

https://github.com/PhilterPaper/Perl-PDF-Builder/commit/d03b59847ecfbf3c7c31b8c1901d3878dba08040#diff-44803d0b8089ee5eb36d750b5be96b6038d4f32687973371d4c67310afc81ae1

i.e. the author should be Phil Perry, who is also the upstream maintainer.
bilevel_tiff.patch
OpenPGP_signature

Jeff

unread,
Apr 13, 2021, 2:00:03 PM4/13/21
to
On 13/04/2021 15:29, Francesco Potortì wrote:
> Ok, thanks. Should I send you the log you requested previously,
> relative to compression?

Did the new version of PDF::Builder solve the problem?

Did selecting compression=Auto or compression=Flate solve the problem?

If so, then another log file would be great.

OpenPGP_signature

Francesco Potortì

unread,
Apr 19, 2021, 10:10:03 AM4/19/21
to
>Did the new version of PDF::Builder solve the problem?

Yes, it did, without any further change. I have created the pdf and the
log files at http://fly.isti.cnr.it/tmp/gscan2pdf with exactly the same
procedure as before.

>Did selecting compression=Auto or compression=Flate solve the problem?

I had not time to try it at the moment, and now my library is updated
and everything works alright. However, I enabled compression=Auto and
created a further log and pdf, which you find in the same place.

By the way, I have no "Flate" compression to choose. I have Auto, LZW,
Zip, Packbits, G3, G4, PNG, JPEG, None.

Thanks for your work
0 new messages