Bug 29246 - PDF files generated by gscan2pdf are blank
Summary: PDF files generated by gscan2pdf are blank
Status: RESOLVED OLD
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2021-07-12 12:53 CEST by papoteur
Modified: 2023-10-26 15:07 CEST (History)
5 users (show)

See Also:
Source RPM: gscan2pdf-2.11.0-1.mga8.src.rpm
CVE:
Status comment:


Attachments
Log from the sequence scan-save in PDF (5.36 KB, application/x-xz)
2021-07-16 09:02 CEST, papoteur
Details
Scanned document (123.88 KB, application/pdf)
2021-07-16 09:04 CEST, papoteur
Details
pdf file created by gscan2pdf (862.95 KB, application/pdf)
2021-07-16 10:19 CEST, Aurelien Oudelet
Details
log from gscan2pdf (143.44 KB, text/plain)
2021-07-16 10:26 CEST, Aurelien Oudelet
Details
Strace while scanning 1 page then saving as PDF (233.61 KB, application/x-xz)
2021-09-06 10:16 CEST, papoteur
Details

Description papoteur 2021-07-12 12:53:28 CEST
Description of problem:
PDF files generated by gscan2pdf are blank

Version-Release number of selected component (if applicable):


How reproducible:
gscan2pdf --log=~/gscan.log
Use of uninitialized value $log in concatenation (.) or string at /usr/bin/gscan2pdf line 818.
Your system does not have Image::PNG::Libpng installed, so some
PNG functions may not run correctly.

Every PDF file is blank, aven if the size isn't light.
I didn't find any perl package which seems to provide  Image::PNG::Libpng
Comment 1 Frédéric "LpSolit" Buclin 2021-07-12 16:53:48 CEST
(In reply to papoteur from comment #0)
> I didn't find any perl package which seems to provide  Image::PNG::Libpng

perl-Image-PNG-Libpng-0.560.0-1.mga8
Comment 2 Lewis Smith 2021-07-13 11:52:18 CEST
@Papoteur : thanks for the report.
@Frédéric : thanks for your pointer.

Well, after much struggling to get my Epson Perfection V500 to work on Mageia 8, I installed:  'gscan2pdf-2.11.0-1.mga8'
and was able to test it. You certainly have to know how to drive it!
But it *did* produce correct PDF output.

So looking for 'perl-Image-PNG-Libpng', that was installed (also today):
 $ rpm -q --last perl-Image-PNG-Libpng
 perl-Image-PNG-Libpng-0.560.0-1.mga8.x86_64  Dydd Mawrth 13 mis Gorffennaf 2021 
Where did it come from?
 $ sudo urpmi gscan2pdf
to satisfy dependencies included:
 perl-Image-PNG-Libpng          0.560.0      1.mga8        x86_64

 $ urpmq --requires gscan2pdf | grep perl-Image-PNG-Libpng
 $ 
 $ urpmq --requires-recursive gscan2pdf | grep perl-Image-PNG-Libpng
 perl-Image-PNG-Libpng

So how papoteur did not pick it up is a mystery. I think this should be closed 'invalid', but await papoteur's response (if you agree, please do that).

Source RPM: gscan2pdf => gscan2pdf-2.11.0-1.mga8.src.rpm
CC: (none) => lewyssmith

Comment 3 papoteur 2021-07-13 12:24:51 CEST
rpm -q perl-Image-PNG-Libpng
perl-Image-PNG-Libpng-0.560.0-1.mga8
Thus, it is already installed.
But it seems to not be found.
Thus I don't close ;)
Comment 4 Thomas Backlund 2021-07-13 15:38:56 CEST
(In reply to papoteur from comment #0)

> Every PDF file is blank, aven if the size isn't light.
> I didn't find any perl package which seems to provide  Image::PNG::Libpng

# urpmf --provides  Image::PNG::Libpng
perl-Image-PNG-Libpng:perl(Image::PNG::Libpng)[== 0.560.0]
Comment 5 Aurelien Oudelet 2021-07-13 23:02:28 CEST
This is strange.

Did you, papoteur, try to remove packages and reinstall them after?

CC: (none) => ouaurelien

Comment 6 papoteur 2021-07-14 07:34:53 CEST
Thanks Frédéric and Aurélien,
I removed perl-Image-PNG-Libpng-0.560.0-1.mga8, then reinstalled gscan2pdf. No success.
I removed also ~.config/gscan2pdfrc. No success.
Is there a test for Image::PNG::Libpng?
Comment 7 Lewis Smith 2021-07-15 20:44:05 CEST
@Aurélien : as a control, can you install & try 'gscan2pdf' with PDF output (because it offers other formats)? In case I made some mistake in saying it worked for me.

Awaiting that, we seem to have here a situation where the package works for some but not others... And finding the difference is never easy.

@Papoteur : what desktop are you using?
If you have more than one installed, try another.
For us to try & reproduce the fault, please say *exactly* all the precise steps you take to arrive at the bad result: all the menu & dialogue choices, in order. There may be multiple paths to the end result, we need to follow the same one.

Ever confirmed: 1 => 0
Status: NEW => UNCONFIRMED

Comment 8 Aurelien Oudelet 2021-07-15 23:20:22 CEST
(In reply to Lewis Smith from comment #7)
> @Aurélien : as a control, can you install & try 'gscan2pdf' with PDF output
> (because it offers other formats)? In case I made some mistake in saying it
> worked for me.

Sure, I test this.

MGA8-64 Plasma under a VM installed from Live ISO.
Freshly updated.

First:
> $ rpm -qa | grep perl-Image-PNG-Libpng

Nothing.

$ LANG=C sudo urpmi gscan2pdf
To satisfy dependencies, the following packages are going to be installed:
  Package                        Version      Release       Arch    
(medium "Core Release (distrib1)")
  gocr                           0.52         2.mga8        x86_64  
  goocanvas2-i18n                2.0.4        3.mga8        noarch  
  gscan2pdf                      2.11.0       1.mga8        noarch  
  jpeg-progs                     2.0.5        1.mga8        x86_64  
  lib64goocanvas-gir2.0          2.0.4        3.mga8        x86_64  
  lib64goocanvas2.0_9            2.0.4        3.mga8        x86_64  
  lib64netpbm11                  10.87.01     3.mga8        x86_64  
  lib64turbojpeg0                2.0.5        1.mga8        x86_64  
  libtiff-progs                  4.2.0        1.mga8        x86_64  
  netpbm                         10.87.01     3.mga8        x86_64  
  perl-B-Hooks-EndOfScope        0.240.0      4.mga8        noarch  
  perl-Bit-Vector                7.400.0      13.mga8       x86_64  
  perl-Carp-Clan                 6.80.0       2.mga8        noarch  
  perl-Class-Data-Inheritable    0.80.0       9.mga8        noarch  
  perl-Config-General            2.630.0      3.mga8        noarch  
  perl-Data-UUID                 1.226.0      2.mga8        x86_64  
  perl-Date-Calc                 6.400.0      5.mga8        noarch  
  perl-Devel-GlobalDestruction   0.140.0      3.mga8        noarch  
  perl-Devel-StackTrace          2.40.0       2.mga8        noarch  
  perl-Dist-CheckConflicts       0.110.0      7.mga8        noarch  
  perl-Email-Date-Format         1.5.0        5.mga8        noarch  
  perl-Eval-Closure              0.140.0      3.mga8        noarch  
  perl-Exception-Class           1.440.0      3.mga8        noarch  
  perl-Exporter-Tiny             1.2.2        1.mga8        noarch  
  perl-ExtUtils-CBuilder         0.280.235    1.mga8        noarch  (recommended)
  perl-Font-TTF                  1.60.0       3.mga8        noarch  
  perl-GooCanvas2                0.60.0       3.mga8        noarch  
  perl-Graphics-TIFF             7.0.0        1.mga8        x86_64  
  perl-Gtk2                      1.249.930    3.mga8        x86_64  
  perl-Gtk2-Ex-PodViewer         0.180.0      10.mga8       noarch  
  perl-Gtk2-Ex-Simple-List       0.500.0      9.mga8        noarch  
  perl-Gtk3-ImageView            4.0.0        1.mga8        noarch  
  perl-IO-String                 1.80.0       9.mga8        noarch  
  perl-Image-PNG-Libpng          0.560.0      1.mga8        x86_64  
  perl-Image-Sane                5.0.0        3.mga8        x86_64  
  perl-List-MoreUtils            0.430.0      1.mga8        noarch  
  perl-List-MoreUtils-XS         0.430        1.mga8        x86_64  
  perl-Locale-Codes              3.660.0      1.mga8        noarch  
  perl-Log-Dispatch              2.700.0      1.mga8        noarch  
  perl-Log-Log4perl              1.530.0      1.mga8        noarch  
  perl-MIME-Lite                 3.31.0       2.mga8        noarch  
  perl-MIME-Types                2.180.0      1.mga8        noarch  
  perl-MRO-Compat                0.130.0      3.mga8        noarch  
  perl-Mail-Sender               0.903.0      3.mga8        noarch  
  perl-Mail-Sendmail             0.800.0      4.mga8        noarch  
  perl-Module-Build              0.423.100    2.mga8        noarch  
  perl-Module-Implementation     0.90.0       7.mga8        noarch  
  perl-Module-Runtime            0.16.0       3.mga8        noarch  
  perl-PDF-Builder               3.21.0       1.mga8        noarch  
  perl-Package-Stash             0.390.0      1.mga8        noarch  
  perl-Package-Stash-XS          0.290.0      4.mga8        x86_64  
  perl-Params-ValidationCompiler 0.300.0      3.mga8        noarch  
  perl-Pod-Parser                1.630.0      6.mga8        noarch  
  perl-Proc-ProcessTable         0.590.0      4.mga8        x86_64  
  perl-Readonly                  2.50.0       3.mga8        noarch  
  perl-Reaper                    1.0.0        11.mga8       noarch  
  perl-Role-Tiny                 2.1.4        2.mga8        noarch  
  perl-Set-IntSpan               1.190.0      8.mga8        noarch  
  perl-Specio                    0.460.0      1.mga8        noarch  
  perl-Sub-Exporter-Progressive  0.1.13       3.mga8        noarch  
  perl-Sub-Identify              0.140.0      8.mga8        x86_64  
  perl-Sub-Quote                 2.6.6        2.mga8        noarch  
  perl-Test-Fatal                0.16.0       1.mga8        noarch  
  perl-Variable-Magic            0.620.0      6.mga8        x86_64  
  perl-XML-DOM                   1.460.0      3.mga8        noarch  
  perl-XML-RegExp                0.40.0       9.mga8        noarch  
  perl-XString                   0.5.0        1.mga8        x86_64  
  perl-libxml-perl               0.80.0       10.mga8       noarch  
  perl-namespace-autoclean       0.290.0      3.mga8        noarch  
  perl-namespace-clean           0.270.0      4.mga8        noarch  
  sane-frontends                 1.0.14       27.mga8       x86_64  
  transfig                       3.2.7b       3.mga8        x86_64  
  unpaper                        6.1          4.mga8        x86_64  
(medium "Core Updates (distrib3)")
  canberra-gtk                   0.30         15.1.mga8     x86_64  (recommended)
  djvulibre                      3.5.28       1.1.mga8      x86_64  
  lib64canberra-gtk0             0.30         15.1.mga8     x86_64  (recommended)
  lib64canberra-gtk3_0           0.30         15.1.mga8     x86_64  (recommended)
(medium "Tainted Updates (distrib23)")
  perl-Image-Magick              7.0.10.62    1.mga8.taint> x86_64  
61MB of additional disk space will be used.
17MB of packages will be retrieved.
Proceed with the installation of the 78 packages? (Y/n)Y

This seems to install OK on a clean install.

Running it:

$ gscan2pdf --log=/tmp/gscan2pdf.log

Nothing wrong UI is loaded. Scanner not available (this is a VM), I will test this later on real hardware.

Perhaps useful infos in the log:

INFO - pdftops -v
INFO - pdftops -v: command not found
INFO - pdfunite -v
INFO - pdfunite -v: command not found
INFO - gs --version
INFO - Spawned PID 8480
INFO - Found pdf2ps 9.53.3
INFO - pdftk --version
INFO - pdftk --version: command not found

$ urpmf - f pdftops
poppler-20.12.1-1.mga8.x86_64:/usr/bin/pdftops
poppler-20.12.1-1.mga8.x86_64:/usr/share/man/man1/pdftops.1.xz
cups-filters-1.28.7-1.mga8.x86_64:/usr/lib/cups/filter/pdftops

$ urpmf -f pdfunite
poppler-20.12.1-1.mga8.x86_64:/usr/bin/pdfunite
poppler-20.12.1-1.mga8.x86_64:/usr/share/man/man1/pdfunite.1.xz
...

$ urpmf -f pdftk
...
zsh-5.8-3.mga8.x86_64:/usr/share/zsh/5.8/functions/Completion/X/_pdftk
pdftk-java-3.2.1-1.mga8.noarch:/usr/bin/pdftk
pdftk-java-3.2.1-1.mga8.noarch:/usr/share/doc/pdftk-java
...

$ rpm -qa | grep poppler
lib64poppler-qt5_1-20.12.1-1.mga8
lib64poppler105-20.12.1-1.mga8
lib64poppler-glib8-20.12.1-1.mga8
poppler-data-0.4.10-1.mga8

DOH!! poppler-20.12.1-1.mga8 package, which contains pdfunite and pdftops, is not installed, so does pdftk-java

Culprit here.

@papoteur, this app seems to need some tools available from poppler package which seems not installed by default on clean install from Plasma Live ISO.

But, digging further, poppler is installed as soon as you set up a printer...
I will no going further.

Are all above 78 packages installed?

I will test later on real hardware.
Comment 9 papoteur 2021-07-16 09:01:19 CEST
Hello Lewis and Aurélien.
The installation was previously installed in Mageia 6, migrated to 7, then 8. O use LXQt, but I think that Plasma was installed.
rpm -qa | grep poppler
lib64poppler-glib8-20.12.1-1.mga8
lib64poppler-cpp0-20.12.1-1.mga8
python3-poppler-qt5-0.75.0-2.mga8
poppler-data-0.4.10-1.mga8
lib64poppler85-0.74.0-3.4.mga7
lib64poppler-gir0.18-20.12.1-1.mga8
poppler-20.12.1-1.mga8
lib64poppler105-20.12.1-1.mga8
lib64poppler-qt5_1-20.12.1-1.mga8

rpm -qa|grep pdftk
pdftk-java-3.2.1-1.mga8

What I do:
open gscan2pdf
Open the window for scanning.  Brother MFC-9330CDW is selected
Mode B&W, 300 dpi, Luminosité 0%
Size A4

Scanning

Save, type de document: PDF (Other formats are OK)
Compression: automatique
Position of OCR output : Behind
Police: DejaVu Serif Condensed Bold Italic
Comment 10 papoteur 2021-07-16 09:02:42 CEST
Created attachment 12863 [details]
Log from the sequence scan-save in PDF
Comment 11 papoteur 2021-07-16 09:04:42 CEST
Created attachment 12864 [details]
Scanned document

It is displayed blank in Okular and other viewers
Comment 12 papoteur 2021-07-16 09:46:58 CEST
I tried other compression formats, other resolutions, Gray or color, always with the same result: blank page(s).
Comment 13 Aurelien Oudelet 2021-07-16 10:19:01 CEST
Created attachment 12865 [details]
pdf file created by gscan2pdf

Nope. I confirm I can scan and later save a multi-pages document as PDF.
I attach here a book cover scanned with gscan2pdf.
Comment 14 Aurelien Oudelet 2021-07-16 10:26:11 CEST
Created attachment 12866 [details]
log from gscan2pdf

Attached here log from last comment generated pdf.
Comment 15 Aurelien Oudelet 2021-07-16 10:29:31 CEST
Note that this is on real hardware with a networked scanner.
Comment 16 Aurelien Oudelet 2021-07-16 10:33:23 CEST
Note also I uncheck OCR function under the "Scanning" window.
Comment 17 Rolf Pedersen 2021-07-17 21:11:22 CEST
After learning the the sequence of steps, meaning of buttons, I've used this program successfully with a newer HP AIO.  In Edit > Preferences, I see libimage-sane-perl is the configured frontend, fwiw

CC: (none) => rolfpedersen

Comment 18 Lewis Smith 2021-07-17 22:01:47 CEST
Aurélien might be on the right path suspecting the need for some other software that I and he have, but not papoteur. I do not think PDFwhatever are relevant. This is what I have for poppler:
 lib64poppler102-20.09.0-1.mga8
 lib64poppler105-20.12.1-1.mga8
 lib64poppler-cpp0-20.12.1-1.mga8
 lib64poppler-glib8-20.12.1-1.mga8
 lib64poppler-qt5_1-20.12.1-1.mga8
 poppler-20.12.1-1.mga8
 poppler-data-0.4.10-1.mga8
Papoteur has a couple more, so it is not a question of something missing here.

Like Aurélien, I UNchecked the OCR box; it was not sensible for my test scan. I will try again with an OCRable document - tomorrow!
Comment 19 Lewis Smith 2021-07-18 21:24:54 CEST
Under LxQt.

(In reply to papoteur from comment #9)
> What I do:
> open gscan2pdf
> Open the window for scanning.  Brother MFC-9330CDW is selected
> Mode B&W, 300 dpi, Luminosité 0%
Device = Epson Perfection V500
In the 'Scan mode' tab:
In English is this Scan Mode 'Binary' or 'Grey'? If I select 'binary', the Brighteness etc fields are greyed; to see them, have to select 'grey'.
DPI: the Scan Resolution dropdown shows 200/400/800 etc, no 300!
Ticked the OCR box.

> Size A4
In the hidden 'Geometry' tab.

Scan (1 printed page).
> Save, type de document: PDF (Other formats are OK)
> Compression: automatique
> Position of OCR output : Behind
Save dialogue:
Page range = all, Document type PDF.
Compression & Position same, both as presented.
> Police: DejaVu Serif Condensed Bold Italic
Chose this, 10pt. [A strange font choice; presumably for OCR]

The 1-page PDF is quite correct; I do not bother to attach it (voulez-vous voir un Attestation de Déplacement?!)
-------------------------------------
A thought: this sample PDF was about 100Kb. What size is a 1-page papoteur saved but empty PDF? Remember that the scanned page is an image, so any text in it is invisible. But if you hexedit or od the PDF, you do see a lot of PDF red-tape strings. Do you see those at least?

Ah! did it myself from https://bugs.mageia.org/attachment.cgi?id=12864
(papoteur's blank page). This is about 124Kb, and comparing embedded red-tape string groups, I see similar things in this & my own test PDF. With hexedit:
around 12%; 29% (2 adjacent groups; my equivalent groups are widely spaced); at end

As for why this is not working for him, another idea. He has un-installed it & re-installed it. What if the latter used something old in the RPM cache? I suggest:
- urpme it
- clear all orphans
- clear the RPM cache
- urpmi it again.
Comment 20 Lewis Smith 2021-07-18 21:56:19 CEST
Some more exploring.
With my own test PDF:
$ gs Desktop/mypapoteur.pdf
GPL Ghostscript 9.53.3 (2020-10-01)
Copyright (C) 2020 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Processing pages 1 through 1.
Page 1
Loading NimbusRoman-Regular font from /usr/share/ghostscript/9.53.3/Resource/Font/NimbusRoman-Regular... 4523108 2931527 6452568 5121022 4 done.
>>showpage, press <return> to continue<<
[displays the PDF]

With papoteur's blank one:
$ gs Desktop/papoteur.pdf
GPL Ghostscript 9.53.3 (2020-10-01)
Copyright (C) 2020 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
   **** Warning: PDF version number not followed by EOL.
   **** Error: Unknown operator: '595,20'
   **** Error: Unknown operator: '824,88'
Processing pages 1 through 1.
Page 1
   **** Error: Page has an invalid /MediaBox attribute. Using the current page size.
               Output may be incorrect.
   **** Error: Page has an invalid /MediaBox attribute. Using the current page size.
               Output may be incorrect.
   **** Error: Unknown operator: '595,20'
   **** Error: Unknown operator: '824,88'
   **** Error reading a content stream. The page may be incomplete.
               Output may be incorrect.
Error: /typecheck in /--pdfshowpage_finish--
Operand stack:
   --dict:7/15(L)--   --nostringval--   --nostringval--   10   --nostringval--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   pdfshowpage_finish   --nostringval--   2   %stopped_push   --nostringval--   pdfshowpage_finish   pdfshowpage_finish   false   1   %stopped_push   1990   1   3   %oparray_pop   1989   1   3   %oparray_pop   1977   1   3   %oparray_pop   1978   1   3   %oparray_pop   pdfshowpage_finish   pdfshowpage_finish   2   1   1   pdfshowpage_finish   %for_pos_int_continue   1981   1   7   %oparray_pop   pdfshowpage_finish   pdfshowpage_finish   pdfshowpage_finish   %loop_continue   pdfshowpage_finish
Dictionary stack:
   --dict:731/1123(ro)(G)--   --dict:1/20(G)--   --dict:80/200(L)--   --dict:80/200(L)--   --dict:133/256(ro)(G)--   --dict:318/325(ro)(G)--   --dict:33/64(L)--   --dict:6/9(L)--   --dict:6/20(L)--   --dict:1/1(ro)(G)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.53.3: Unrecoverable error, exit code 1

So Ghostscript does not like the blank one at all! It briefly showed the blank page before exiting.
-------------------
Looking at papoteur's attached log file:
 https://bugs.mageia.org/attachment.cgi?id=12863
starting at line "INFO - Importing scan with resolution=300,300"
later "DEBUG - Finished setting page_number_start from 1 to 2"
then "INFO - New page filename" & "INFO - New page written" *twice*.
Yves: was your test 1 or 2 pages?

I need to re-do my own 1p test with a similar log, to compare.
Comment 21 papoteur 2021-07-19 15:48:17 CEST
Hi Lewis, Rolf,
My test was only one page.
I didn't explore for now the Edit Preferences. 
 libimage-sane-perl is the frontend, too.
The interesting thing I see is, in the next tab, I see this option:
Convert scanned images to PNG before further processing.
It was checked. Without checking it, I got a clean PDF document. With checking, a blank page. This is with loading an image instead of scanning, since I'm not at home, thus I'm without scanner.
What is it for you?
Comment 22 Rolf Pedersen 2021-07-19 17:27:15 CEST
The convert to PNG option is checked here.  Apparently, that is default.  Scanning from flatbed or automatic document feeder, with multiple pages per document is working for me.  The pdf has no text selection capabilities, as it's an image, apparently, but I've accepted that.  After unchecking the convert to PNG, a pdf document is produced that is visually the same and still does not have text selection in okular.  I see the Advanced tab of the scan dialog provides only JPEG for the compression method, which might be a clue.

I don't know what you mean by "This is with loading an image instead of scanning".  I notice in the save dialog there is PDF and various image formats.  I have that always set to PDF.

In scan mode of the scan dialog, mine has been set to lineart, which produces black characters on a white background.  When I choose Gray, the pdf shows various bleed-through from the back of the original and smudges in, I guess, intermediate values of gray.  No combination of options and settings I have tried produces selectable text.  Sorry but I think that displays my ignorance about the technology.  I guess the scanner can only produce an image.  Probably, my experience with selectable text is with pdf produced by the print/save-to-file process.
Comment 23 Lewis Smith 2021-07-19 20:59:10 CEST
Thanks both for your research.
@Rolf: The question of selectable text from any image (whether directly from an image file, or scanned; in a PDF or not) is meaningless. That applies only to PDFs produced by text-producing applications.
> I don't know what you mean by "This is with loading an image instead
> of scanning"
The program offers an existing image as its 'input' (2nd menu bar icon).

As for the PNG image format, that seems to be the default. Near the end of the log:
INFO - New page filename /tmp/gscan2pdf-wQeS/gjhLjmrPOg.png, format Portable Net
work Graphics
INFO - New page written as /tmp/gscan2pdf-wQeS/jObbuqA54I.png (8A3E1DD4-E603-11E
B-8744-38B792E02A74)
INFO - Converted /tmp/gscan2pdf-wQeS/xbJz0LIivb.pnm to /tmp/gscan2pdf-wQeS/jObbuqA54I.png
INFO - Replaced /tmp/gscan2pdf-wQeS/xbJz0LIivb.pnm (89F0D0CE-E603-11EB-8744-38B792E02A74) at page 1 with /tmp/gscan2pdf-wQeS/XiUQhFJv0C.png (89F0D0CE-E603-11EB-8744-38B792E02A74), resolution 300,300

I am about to do a 1p test as per comment 19 + log to compare with paoteur's.
Comment 24 Lewis Smith 2021-07-19 22:17:25 CEST
Some differences:
DEBUG - Finished setting paper from undef to A4
DEBUG - Started setting num_pages from 1 to 0        *P only*
DEBUG - Finished setting num_pages from 1 to 0       *P only*
DEBUG - Started setting cursor from wait to default
...
INFO - Scanning 0 pages from 1 with step 1             *P*
INFO - Scanning 1 pages from 1 with step 1             *L*
DEBUG - signal 'started-process' emitted with message: Num<E9>risation page 1 *P*
DEBUG - signal 'started-process' emitted with message: Scanning page 1 of 1   *L*
...
DEBUG - Started setting page_number_start from 1 to 2     *same lines for both*
DEBUG - Started setting max_pages from 0 to -1
DEBUG - Finished setting max_pages from 0 to -1
DEBUG - Finished setting page_number_start from 1 to 2
INFO - Added /tmp/... at page 1 ...
...
INFO - Scanning 0 pages from 1 with step 1         *these lines P only*
DEBUG - signal 'started-process' emitted with message: Num<E9>risation page 2
DEBUG - signal 'finished-process' emitted with data: scan_pages
DEBUG - Started setting cursor from progress to default
DEBUG - Finished setting cursor from progress to default
...
INFO - Replaced /tmp/....pnm ... at page 1 with /tmp/....png ...
INFO - writing temporary image /tmp/0Ia3jTAhyH.pnm      *These 4 INFO lines*
INFO - gocr /tmp/0Ia3jTAhyH.pnm -o /tmp/5cauP2BEoX.txt  *L only*
INFO - Spawned PID 4485                                 *Maybe to do with OCR*
INFO - Replaced /tmp/....png ... at page 1 with /tmp/....png ...
DEBUG - save filename dialog returned ok
...
DEBUG - Using TTF for 'ĉ' in 'l          *L only*
...
INFO - Added /tmp/gscan2pdf-wQeS/XiUQhFJv0C.png at 300 PPI    *P*
INFO - Added /tmp/gscan2pdf-tfWd/nAZtXxm2Eq.png at 100 PPI    *L*
INFO - Closing PDF
...

I still wonder about the "setting num_pages from 1 to 0" and "page 2" ref for papoteur.

Another thought to research: I believe there are ways of extracting images from PDFs. We can try to check whether papoteur's blank PDF (which 'gs' hated) has the embedded image.
Comment 25 Lewis Smith 2021-07-30 20:39:28 CEST
Oh, I tried on-line services for extracting the 'image' from the defective PDF (if it is there). One site said it found none; another returned an image which was a grid of smallish squares.

Another idea for us to try: strace.
Yves, if you can re-run your abortive trial (which gave the result as already attached), and attach the strace from that run.
To simplify things mildly, can we forget ticking the 'OCR' box?
And tell me how you get the 300dpi. It occurs to me that this might depend on the scanner used: I only saw 200-400-etc.
And what scan mode you use (B&W | grey | colour).

I will then re-run my test, and compare the straces.
Marja Van Waes 2021-08-10 20:07:24 CEST

Keywords: (none) => NEEDINFO
CC: (none) => marja11

Comment 26 papoteur 2021-09-06 10:13:18 CEST
Hello Lewis, Rolf, Marja,
I was away from scanner some time. Now I have it again.
Thus I tried to have a strace.
I used resolution 300 dpi, Grey.
I think that resolution options are displayed according to scanner.
I still got the message:
"Your system does not have Image::PNG::Libpng installed, so some
PNG functions may not run correctly."
Comment 27 papoteur 2021-09-06 10:16:23 CEST
Created attachment 12925 [details]
Strace while scanning 1 page then saving as PDF
Comment 28 Lewis Smith 2021-09-06 21:40:09 CEST
Noted & thanks. Will do my equivalent strace when I have the time (am very pressed at the moment).
Comment 29 Marja Van Waes 2022-04-22 11:58:51 CEST
(In reply to papoteur from comment #6)

> Is there a test for Image::PNG::Libpng?

It seems we missed that question, sorry.

This command

   perl -e 'use Image::PNG::Libpng'

will return nothing if everything is fine, but will give helpful output if there's a problem, for instance when Image::PNG::Libpng isn't in your @INC include path.


Learning strace is still on my todo list. I only understand that, if there's nothing wrong with Image::PNG::Libpng itself you can also do 

   strace -fq -- perl -e 'use Image::PNG::Libpng' 

If your ¨problem still persists, and no one replies to 
(In reply to papoteur from comment #27)
> Created attachment 12925 [details]
> Strace while scanning 1 page then saving as PDF
do you then mind adding the outputs of the two commands above, just in case?

Grepping for "Libpng" in your strace file returns nothing.

However there are over 5000 lines about not found files or directories, no idea whether they're red herrings or not:

[marja@DenkBlok4 strace-gscan]$ grep ENOENT strace-gscan.txt | wc -l
5196
[marja@DenkBlok4 strace-gscan]$

CC'ing the perl maintainers, who'll know how to read the strace you already attached :-)

CC: (none) => perl

Comment 30 Lewis Smith 2022-04-24 12:34:09 CEST
Please leave this open. I did once try a similar strace, and spent ages comparing it with Papoteur's only to discover I had messed up my test. I will re-try when I have the time; it needs a lot to compare the long straces.

We suspect that this problem stems from the fact that P's system has been updated from M6-7-8, while other participants have a more recent base like M7-8 or new M8.
Comment 31 Lewis Smith 2023-05-17 21:11:31 CEST
Yves, is this still an issue?
I know I shall never have the time to re-run this with a correct trace, and compare that with yours; which is pénible.
Comment 32 Marja Van Waes 2023-10-26 15:07:32 CEST
(In reply to Lewis Smith from comment #31)
> Yves, is this still an issue?
> I know I shall never have the time to re-run this with a correct trace, and
> compare that with yours; which is pénible.

I think Yves is running Mageia 9 now. Also, gscan2pdf was updated for bug 32335, both in Mageia 8 and 9.

Closing as OLD

Status: UNCONFIRMED => RESOLVED
Resolution: (none) => OLD


Note You need to log in before you can comment on or make changes to this bug.