Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1708522 - Changing scan resolution from the default 100 ppi to 200 ppi creates invalid syntax for sane parameters
Summary: Changing scan resolution from the default 100 ppi to 200 ppi creates invalid ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gscan2pdf
Version: 30
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL: https://sourceforge.net/p/gscan2pdf/b...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-10 07:16 UTC by Petr Pisar
Modified: 2019-05-30 12:51 UTC (History)
6 users (show)

Fixed In Version: gscan2pdf-2.5.3-1.fc30
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1708054
Environment:
Last Closed: 2019-05-30 12:51:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
debug log for f29 version of gscan2pdf (41.35 KB, text/plain)
2019-05-10 14:39 UTC, Bob Schultz
no flags Details
f30 debug log (93.48 KB, text/plain)
2019-05-10 14:40 UTC, Bob Schultz
no flags Details
gscan2pdfrc file for gscan2pdf-2.3.0-2.fc30.noarch.rpm execution (3.48 KB, text/plain)
2019-05-13 21:38 UTC, Bob Schultz
no flags Details
Requested gscan2pdf log (96.90 KB, text/plain)
2019-05-17 00:15 UTC, Bob Schultz
no flags Details

Description Petr Pisar 2019-05-10 07:16:19 UTC
+++ This bug was initially created as a clone of Bug #1708054 +++

--- Additional comment from Bob Schultz on 2019-05-09 20:49:32 GMT ---

The update fixes pdftk problem, but there's another bug. Changing scan resolution from the default 100 ppi to 200 ppi creates invalid syntax used for sane parameters:
"default-scan-options" : {
      "backend" : [
         {
            "resolution" : 200
         }
      ]
   },
   "device" : "hp5590:libusb:001:006",
   "device blacklist" : null,
   "downsample" : "",
   "downsample dpi" : 150,
   "frontend" : "libimage-sane-perl",
   "image type" : null,
   "keywords" : null,
   "keywords-suggestions" : null,
   "libimage-sane-perl version" : "0.14",
   "message" : {
      "Error processing with tesseract: Detected %%d diacritics" : {},
      "Some pages have not been saved.\nDo you really want to quit?" : {},
      "gscan2pdf: sane_start: Invalid argument" : {}
   },

This is first use of scanner since f29-->f30 upgrade a week ago. gscan2pdf worked flawlessly for years prior.

Comment 1 Petr Pisar 2019-05-10 08:10:26 UTC
Could you explain me what's going wrong? I don't have any scanner, so I can test it only with a "test:0" dummy driver provided by sane-backends-drivers-scanners RPM package (gscan2pdf --device 'test:0'). And with that dummy driver I can change the resolution to 200 and make scan.

Is that when you start to scan gscan2pdf shows "sane_start: Invalid argument" error message?

Can you obtain as 200-PPI scan with a different tool? E.g. scanimage from sane-backends RPM package can be used like this:

$ scanimage -d 'test:0' -A
[...]
    --resolution 1..1200dpi (in steps of 1) [50]
        Sets the resolution of the scanned image.
[...]


displays all options 'test:0' device implements, and --resolution is what I need. Then I can use:

$ scanimage -d 'test:0' --resolution 200 >/tmp/img

and /tmp/img will contain the scanned image in Netpbm format. When I change resoltion, I can see the size and number of pixels of the output image changes.

I think you could try use 'hp5590:libusb:001:006' instead of 'test:0'. Does that work for you? If not, then there is some bug in hp5590 Sane driver. Otherwise it's some issue in gscan2pdf or some of the libraries used by it.

You can also install gscan2pdf for Fedora 29 into you system. It's available at <https://kojipkgs.fedoraproject.org//packages/gscan2pdf/2.3.0/2.fc29/noarch/gscan2pdf-2.3.0-2.fc29.noarch.rpm>. And check if it works for you or not. Maybe you will need to delete ~/.config/gscan2pdfrc configuration file first as it is quite possible that older gscan2pdf could misinterpret the configuration created by the newer gscan2pdf.

If it turns out not to be an issue in Sane drivers, then I will forward it to gscan2pdf author at <https://sourceforge.net/p/gscan2pdf/bugs/>. He will probably need a detailed log from gscan2pdf that can be obtained when starting gscan2pdf with "gscan2pdf --log=/tmp/log" command and then posting the /tmp/log file content.

Comment 2 Bob Schultz 2019-05-10 14:38:39 UTC
The new F30 gscan2pdf is failing when the scan resolution is changed from the default 100 to something else. I just tested the F29 version and it works fine. I'm just leaving for out of town, won't be back until Monday to be able to test anything. I'm planning to attach both the F29 and the F30 debug logs for reference. For now I'll be using the F29 version until it is resolved. Thanks.

Comment 3 Bob Schultz 2019-05-10 14:39:57 UTC
Created attachment 1566675 [details]
debug log for f29 version of gscan2pdf

f29 debug log per request

Comment 4 Bob Schultz 2019-05-10 14:40:57 UTC
Created attachment 1566676 [details]
f30 debug log

f30 version gscan2pdf debug log

Comment 5 Petr Pisar 2019-05-13 08:38:49 UTC
The F29 log seems it scans a letter-sized paper in 100 DPI. Are you sure you changed the setting to 200 DPI when you were trying F29 version?

The F30 log does not provide many more details. It shows the 200 DPI resolution was accepted by a scanner (or a driver) and then when scanning started sane_start() method returned "Invalid argument" error. The "Invalid argument" string comes from sane-backends Sane library. The error is captured by Image::Sane::Device->start() and then forwarded to Gscan2pdf::Frontend::Image_Sane::_thread_scan_page_to_fh() or scan2pdf::Frontend::Image_Sane::_thread_scan_page() (both use the same error message format). Since gscan2pdf already logs at debug level when --log option is supplied, I worry we cannot get any more details from gscan2pdf. But I think adding --debug option to gscan2pdf should enable debugging in Image::Sane library. You could try that.

Another way of finding the issue is trying different versions of gscan2pdf code. If you can work with git tool at <git://git.code.sf.net/p/gscan2pdf/code> is a Git repository of gscan2pdf. You can try various commits between 2.3.0 and 2.5.2 versions.

I'm sorry I'm unable to help you more because I cannot reproduce this issue.

Comment 6 Bob Schultz 2019-05-13 21:35:59 UTC
Here's what I have been able to determine so far:
version gscan2pdf-2.3.0-2.fc30.noarch.rpm works ok

version gscan2pdf-2.4.0-1.fc30.noarch.rpm breaks as soon as the resolution is changed from the default 100ppi

When using default resolution which is set to null, gscan2pdf can be run ok. It can be quit and restarted at will, and works. That is because no
"default-scan-options" : {
      "backend" : [
         {
            "resolution" : 200
         }
      ]
   },
section is present in the gscan2pdfrc file. Once resolution is changed upwards, the section above is added to gscan2pdf, and causes an error.

When starting gscan2pdf with no .config/gscan2pdfrc file existing, the resolution can be set high (200ppi & up) and it functions (verified it is actually higher resolution). However when gscan2pdf is started AGAIN with the then existing gscan2pdfrc file in .config/, the invalid argument message pops up.

The gscan2pdf-2.3.0-2 version works correctly WITH the

   "default-scan-options" : {
      "backend" : [
         {
            "resolution" : 300
         }
      ]
   },
section.

I'm attaching the 2.3.0-2 gscan2pdfrc file for reference.

Comment 7 Bob Schultz 2019-05-13 21:38:33 UTC
Created attachment 1568148 [details]
gscan2pdfrc file for gscan2pdf-2.3.0-2.fc30.noarch.rpm execution

.config file for 300 dpi runs with gscan2pdf-2.3.0-2.fc30.noarch.rpm version

Comment 8 Petr Pisar 2019-05-14 09:15:21 UTC
There were few changes regarding setting a scanner configuration between 2.3.0 and 2.4.0. However, why 200 fails and 300 works is strange.

I forwarded your issue to the gscan2pdf author at <https://sourceforge.net/p/gscan2pdf/bugs/324/>. If you can please, talk to him there.

Comment 9 Bob Schultz 2019-05-14 12:21:24 UTC
Just to be clear, it is not a 200 vs. 300 issue at all. It is an "anything above default setting" issue, with the default being 100ppi and gscan2pdfrc (when created) containing:

"default-scan-options" : null,

when the resolution has not be changed from default,

and

   "default-scan-options" : {
      "backend" : [
         {
            "resolution" : 200
         }
      ]
   },

whenever the resolution has be changed. Note the 200 could be anything, 300, 600, doesn't matter.
NOTE that if the final scan is at 100ppi (default value), the gscan2pdfrc file entry is set to "default-scan-options" : null, again

There are three identifiable states which can exist:

1)no gscan2pdfrc file in .config
Application will scan at any resolution requested. Higher resolutions were tested to be positive it is truly hi-res (scanner buzzes slowly rather than high speed sweep).

2)gscan2pdfrc file exists in .config with '"default-scan-options" : null,' entry
Application will scan at any resolution requested. Application can be started repeatedly, no errors reported.

3)gscan2pdfrc file exists in .config with:

   "default-scan-options" : {
      "backend" : [
         {
            "resolution" : xxx
         }
      ]
   },
where xxx can be any saved prior run last resolution OTHER THAN 100ppi. When 100ppi is last scan resolution, gscanpdfrc is saved with "default-scan-options" : null,

So the issue seems to indicate that gscan2pdf ver. 2.4.0 and above cannot handle processing gscan2pdfrc containing the

   "default-scan-options" : {
      "backend" : [
         {
            "resolution" : xxx
         }
      ]
   },

section. It is unclear why ver. 2.3.0 handles that section with no problem, and it seems odd that anything to do with Sane libraries would change between 2.3.0 and 2.4.0.

Comment 10 Petr Pisar 2019-05-16 13:03:59 UTC
(In reply to Bob Schultz from comment #3)
> Created attachment 1566675 [details]
> debug log for f29 version of gscan2pdf
> 
> f29 debug log per request

According to gscan2pdf author this log shows a scan with 100 DPI resolution. Not 200 DPI.

Could you please try it again? He's interested in a log from 2.3.0 version with a resolution explicitly set too 200.

Comment 11 Bob Schultz 2019-05-17 00:14:09 UTC
Happy to provide. File gscan2pdf-2.3.0-2.fc30.log to be uploaded. Prior saved gscan2pdfrc state was already set for 200 dpi. Scan worked correctly.

Comment 12 Bob Schultz 2019-05-17 00:15:20 UTC
Created attachment 1569872 [details]
Requested gscan2pdf log

Version 2.3.0-2 scan log at 200ppi, working correctly.

Comment 13 Petr Pisar 2019-05-17 15:07:33 UTC
Thanks. The author has some idea and after he will write a patch, he would like ask you to test it. Do you know how to test patches, or a code in a Git tree? Or should I package it to an RPM package and give you a link to the testing RPM package?

Comment 14 Bob Schultz 2019-05-17 23:26:46 UTC
Thank you Peter. I haven't tested patches or used a Git tree in very long time, so it would best for me to have a link to a testing RPM package.

Comment 15 Bob Schultz 2019-05-17 23:28:15 UTC
Sorry Petr, I spelled your name wrong.

Comment 16 Petr Pisar 2019-05-20 10:01:11 UTC
I built the patched package and uploaded it at <https://ppisar.fedorapeople.org/gscan2pdf-2.5.2-3.fc30/gscan2pdf-2.5.2-3.fc30.noarch.rpm>. Can you check whether it fixes the issue for you? If it does not, please provide the debug log.

Comment 17 Bob Schultz 2019-05-20 15:17:41 UTC
Thank you Petr! Tested the patched version you built and it works well!

Comment 18 Fedora Update System 2019-05-21 12:38:54 UTC
gscan2pdf-2.5.3-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-2444e3d782

Comment 19 Fedora Update System 2019-05-22 01:44:17 UTC
gscan2pdf-2.5.3-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-2444e3d782

Comment 20 Fedora Update System 2019-05-30 12:51:36 UTC
gscan2pdf-2.5.3-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.


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