Bug 246038

Summary: hplip: scanimage ignores device specific --contrast option
Product: [Fedora] Fedora Reporter: Bernard Johnson <bjohnson>
Component: hplipAssignee: Tim Waugh <twaugh>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 10CC: jeffrey.ratcliffe, nphilipp, triage
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-18 05:56:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
debug output
none
xsane debug output none

Description Bernard Johnson 2007-06-28 00:33:48 UTC
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-06 00:45:34 UTC
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 11:25:18 UTC
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 17:54:22 UTC
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 18:22:12 UTC
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 14:07:26 UTC
(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 15:34:22 UTC
(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 15:44:30 UTC
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 15:58:38 UTC
Wow, that's contrary to "device specific" :)

Thanks for the explanation Tim.

Comment 9 Jeffrey Ratcliffe 2007-07-10 04:57:11 UTC
> 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 09:48:47 UTC
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 10:29:29 UTC
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 13:18:13 UTC
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-13 04:33:48 UTC
$ 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-26 01:56:02 UTC
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 12:20:02 UTC
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 05:56:25 UTC
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.