This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 246038 - hplip: scanimage ignores device specific --contrast option
hplip: scanimage ignores device specific --contrast option
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: hplip (Show other bugs)
10
All Linux
low Severity low
: ---
: ---
Assigned To: Tim Waugh
Fedora Extras Quality Assurance
: Reopened, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-27 20:33 EDT by Bernard Johnson
Modified: 2009-12-18 00:56 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-18 00:56:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
debug output (12.58 KB, text/plain)
2007-07-06 13:54 EDT, Bernard Johnson
no flags Details
xsane debug output (165.40 KB, text/plain)
2007-07-06 14:22 EDT, Bernard Johnson
no flags Details

  None (edit)
Description Bernard Johnson 2007-06-27 20:33:48 EDT
Description of problem:
scanimage ignores --contrast option when scanning.  The attached images
represent the output of scanning with contrast 0, 50, and 100:

scanimage --mode Gray --contrast 0 --device-name
'hpaio:/net/HP_Color_LaserJet_2840?ip=192.168.1.11' > 0.pnm
scanimage --mode Gray --contrast 50 --device-name
'hpaio:/net/HP_Color_LaserJet_2840?ip=192.168.1.11' > 50.pnm
scanimage --mode Gray --contrast 100 --device-name
'hpaio:/net/HP_Color_LaserJet_2840?ip=192.168.1.11' > 100.pnm


http://symetrix.com/~bjohnson/projects/fedora/0.pnm
http://symetrix.com/~bjohnson/projects/fedora/50.pnm
http://symetrix.com/~bjohnson/projects/fedora/100.pnm

Notice that they are basically identical.

Scanning with xsane produces images with differing contrast as would be expected.

Version-Release number of selected component (if applicable):
sane-backends-1.0.18-6.fc7
Comment 1 Bernard Johnson 2007-07-05 20:45:34 EDT
Since this is a device specific option, I'm moving it to the package that
supports that option.

Version-Release number of selected component (if applicable):
hplip-1.7.4a-3.fc7

This problem appears in rawhide as well.
Comment 2 Tim Waugh 2007-07-06 07:25:18 EDT
What output do you get when you run that command with SANE_DEBUG_HPAIO=255 set
in the environment?
Comment 3 Bernard Johnson 2007-07-06 13:54:22 EDT
Created attachment 158677 [details]
debug output

SANE_DEBUG_HPAIO=255 scanimage --mode Gray --contrast 100 --device-name
'hpaio:/net/HP_Color_LaserJet_2840?ip=192.168.1.11' > 100.pnm 2> output.txt
Comment 4 Bernard Johnson 2007-07-06 14:22:12 EDT
Created attachment 158680 [details]
xsane debug output

This is debug output from xsane at contrast -92.7.  Changing the contrast with
xsane works.
Comment 5 Tim Waugh 2007-07-09 10:07:26 EDT
(In reply to comment #3)
> Created an attachment (id=158677) [edit]
> debug output
> 
> SANE_DEBUG_HPAIO=255 scanimage --mode Gray --contrast 100 --device-name
> 'hpaio:/net/HP_Color_LaserJet_2840?ip=192.168.1.11' > 100.pnm 2> output.txt

[hpaio] sane_hpaio_control_option (option=contrast action=set value=100):
scan/sane/hpaio.c 2800

The contrast parameter does get set to the correct value.

For the xsane run, it sets the contrast to 50.  I suspect it is performing its
own contrast transformation on the result.

Not all HP scanning devices can have their contrast altered by software -- it
sounds very much like your device is one of those that cannot.
Comment 6 Bernard Johnson 2007-07-09 11:34:22 EDT
(In reply to comment #5)
> Not all HP scanning devices can have their contrast altered by software -- it
> sounds very much like your device is one of those that cannot.

Tim, does this make sense? 

Contrast is listed as one of the options under 'Options specific to device' when
you run 'scanimage -h'.  Doesn't that come from querying the device?  If so, why
would it list contrast if it doesn't accept contrast settings?

Comment 7 Tim Waugh 2007-07-09 11:44:30 EDT
It comes from the driver (hpaio).  Unfortunately it doesn't seem to be possible
for the driver to dynamically alter the list of device-specific options based on
the particular device(s) connected, so it has to always list that option.
Comment 8 Bernard Johnson 2007-07-09 11:58:38 EDT
Wow, that's contrary to "device specific" :)

Thanks for the explanation Tim.
Comment 9 Jeffrey Ratcliffe 2007-07-10 00:57:11 EDT
> It comes from the driver (hpaio).  Unfortunately it doesn't seem to be possible
> for the driver to dynamically alter the list of device-specific options based on
> the particular device(s) connected, so it has to always list that option.

There *are* dynamic options. For my HP OfficeJet, for instance,

scanimage --help --mode=Lineart

gives different options compared to

scanimage -help --mode=Color
Comment 10 Tim Waugh 2007-07-10 05:48:47 EDT
Hmm.  It looks like hpaio just always adds that particular option (contrast) in
but marks it internally as "inactive" unless the device says it will play along:

    hpaio->option[OPTION_CONTRAST].cap = SANE_CAP_SOFT_SELECT |
                                         SANE_CAP_SOFT_DETECT |
                                         SANE_CAP_ADVANCED |
                                         SANE_CAP_INACTIVE;
...
        /* Determine contrast support. */
        if( PmlRequestGet(hpaio->deviceid, hpaio->cmd_channelid,
hpaio->pml.objContrast) != ERROR)
        {
            hpaio->option[OPTION_CONTRAST].cap &= ~SANE_CAP_INACTIVE;
        }

And not only that, but now I see this, just above the code that prints
"(option=contrast action=set value=100)":

        case SANE_ACTION_SET_VALUE:
            if( hpaio->option[option].cap & SANE_CAP_INACTIVE )
            {
                return SANE_STATUS_INVAL;
            }

So obviously that device *is* capable of setting the contrast after all.

I'll ask about this upstream.
Comment 11 Jeffrey Ratcliffe 2007-07-10 06:29:29 EDT
Just for info: Using the HPLIP backend, my HP OfficeJet always offers the
--contrast option, but marks it inactive (in the scanimage --help output).
Comment 12 Bug Zapper 2008-05-14 09:18:13 EDT
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:
http://docs.fedoraproject.org/release-notes/

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 13 Bernard Johnson 2008-11-12 23:33:48 EST
$ scanimage --mode Gray --contrast 100 --device-name 'hpaio:/net/HP_Color_LaserJet_2840?ip=192.168.1.11' > /tmp/100.pnm
scanimage: attempted to set inactive option contrast
Comment 14 Bug Zapper 2008-11-25 20:56:02 EST
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 15 Bug Zapper 2009-11-18 07:20:02 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 16 Bug Zapper 2009-12-18 00:56:25 EST
Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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