Bug 234954 - [RFE] Make scanbuttond a little easier to config
[RFE] Make scanbuttond a little easier to config
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: scanbuttond (Show other bugs)
rawhide
All Linux
medium Severity low
: ---
: ---
Assigned To: Parag AN(पराग)
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-02 23:21 EDT by Chris Bagwell
Modified: 2010-01-28 01:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-01-28 01:12:40 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)
updated buttonpressed.sh (2.31 KB, application/x-shellscript)
2007-04-02 23:23 EDT, Chris Bagwell
no flags Details

  None (edit)
Description Chris Bagwell 2007-04-02 23:21:47 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070313 Fedora/1.5.0.10-5.fc6 Firefox/1.5.0.10

Description of problem:
The upstream scanbuttond does not come with any default behavior when buttons are pressed.  So the Fedora mantainer was good enough to include a script to have some basic scanning behavior.

I made some additions to the script so that users can customize the behavior without understanding command line args for programs used.  Its closer to being able to set options via a /etc/sysconfig file.



1) Probably the biggest improvement will be the "-o fitplot" option to lpr to make printouts actually scale  (down) to fit the page. 
2) it increases/decreases the scan resolution based on what your attempting... A copy operation only needs to be 150 to match xerox quality... Easy flag to change to black&white to make it even faster.  The user probably wants full resolution for EDIT operation and so it increases for that.
3) User can change what buttons map to copy/print/email in a more obvious way if their scanner's button labels don't match script.
4) Quick change variable to switch to A4 paper size scans if your not a US person.
5) Uses ImageMagick to convert the image to JPG before emailing... No one is really going to like sending PNM files in emails.  Probably should make that conversion optional though.
6) Added support for Thunderbird in theory... Current Fedora Core 6 Thundbird has a bug related to -compose flag.  Evolution is giving me problems as well because it never "exits". 

Version-Release number of selected component (if applicable):
scanbuttond-0.2.3-9.fc6

How reproducible:
Always


Steps to Reproduce:
1. Try to configure
2.
3.

Actual Results:


Expected Results:


Additional info:
Comment 1 Chris Bagwell 2007-04-02 23:23:58 EDT
Created attachment 151503 [details]
updated buttonpressed.sh
Comment 2 Parag AN(पराग) 2007-04-02 23:27:51 EDT
Chris,
 thanks for your Feature Request Bug. I had already seen your mail But did not
get time to reply it and work on it. I was about to ask you to file bug and you
already did that :)
  Will take a look into it and reply here.
Thanks for your work.
Comment 3 Parag AN(पराग) 2007-04-03 00:28:30 EDT
Package Built scanbuttond-0.2.3-10.fc7
Test Package and reply back In case you still have any problems with
buttonpressed.sh script so that I can build same for FC6 also :)

May I know on which scanners you are testing this package?
Comment 4 Chris Bagwell 2007-04-03 19:43:40 EDT
Checked a little earlier today and the new RPM wasn't available... Probaby takes
a day to make it in FTP site?

Anyways, I will answer now that I tested only with 1 scanner.  Its a Canon
CanoScan LiDE 25" which isn't listed as supported but does indeed work.  Output
from scanbuttond:

Mar 31 12:50:54 brew4me scanbuttond: found scanner: vendor="Canon", product="Can
oScan LiDE 25", connection="libusb", sane_name="plustek:libusb:002:004"

I specifically commented in the script about lack of locking because this may or
maynot be backend specific.  Plustek backend seems to only process 1 keypress
until script completion.  

I think we are safe by using libusb itself for the lock while SANE is running
but maybe we should be concerned with GIMP editing an image and user printing at
the same time (again, not a problem with my backend).

If it is an issue then this could be resolved without locking by making the
TMPFILE="/tmp/scan$$.pnm" so that different operations could occur at the same
time.  Probably TMPFILE="/tmp/scan$1.pnm" wouldn't use up so much disk space on
shell crashes.

I'll post results of RPM install when I get it.
Comment 5 Parag AN(पराग) 2007-04-03 21:28:31 EDT
(In reply to comment #4)
> Checked a little earlier today and the new RPM wasn't available... Probaby takes
> a day to make it in FTP site?
> 
 Ohh. Looks I requested very early to you for testing a new RPM.

> Anyways, I will answer now that I tested only with 1 scanner.  Its a Canon
> CanoScan LiDE 25" which isn't listed as supported but does indeed work.  Output
> from scanbuttond:
> 
> Mar 31 12:50:54 brew4me scanbuttond: found scanner: vendor="Canon", product="Can
> oScan LiDE 25", connection="libusb", sane_name="plustek:libusb:002:004"
  OK
> 
> I specifically commented in the script about lack of locking because this may or
> maynot be backend specific.  Plustek backend seems to only process 1 keypress
> until script completion.  
> 
> I think we are safe by using libusb itself for the lock while SANE is running
> but maybe we should be concerned with GIMP editing an image and user printing at
> the same time (again, not a problem with my backend).
> 
> If it is an issue then this could be resolved without locking by making the
> TMPFILE="/tmp/scan$$.pnm" so that different operations could occur at the same
> time.  Probably TMPFILE="/tmp/scan$1.pnm" wouldn't use up so much disk space on
> shell crashes.
> 
> I'll post results of RPM install when I get it.

 Thanks for your reply. Remember I have built for devel(FC7) branch only and not
yet for FC6.
Comment 6 Chris Bagwell 2007-04-04 22:03:20 EDT
I upgraded my FC6 box with the devel RPM and all worked fine.

On suggestion though... I don't know how to do this myself as I've never messed
with spec files.

The buttonpressed.sh has a high chance of being modified by endusers since its
basically a configuration file.  Some of the other RPM packages will detect
configuration file changes and do one of two things... 1) Rename the old version
to buttonpressed.rpmold or 2) leave the old version and create the new one as
buttonpressed.rpmnew.

Either way would preserve users changes so they could copy them over to the new
file.
Comment 7 Parag AN(पराग) 2007-04-26 23:16:57 EDT
sorry for being late for reply.
will do it early.
Comment 8 Parag AN(पराग) 2007-05-04 05:35:57 EDT
ok I did that locally and found that rpmlint reported Error on binary RPM with error
executable-marked-as-config-file
Comment 9 Chris Bagwell 2007-05-04 13:41:43 EDT
I guess we should probably do this the right way then.  We can create a real
config file called /etc/sysconfig/scanbuttond and put things like:

EDITBUTTON=1
PRINTBUTTON=2
EMAILBUTTON=3
CUSTOMBUTTON=4
# 8.5 x 11
SCANIMAGE_PAGESIZE="-x 215 -y 279"
# A4
#SCANIMAGE_PAGESIZE="-x 210 -y 297"

Then at the top of /etc/scanbuttond/buttonpressed.sh, we can add "source
/etc/sysconfig/scanbuttond" and remove all those variables from the script.

Probably the MODE and RESOLUTION settings need to be reworked for this. 
Something like in the sysconfig file:

EDIT_MODE=Color
EDIT_RESOLUTION=300
ect,etc

and then in buttonpressed.sh change to:

if [ "$1"x = "$EDITBUTTON"x ] ; then
  MODE=$EDIT_MODE
  RESOLUTION=$EDIT_RESOLUTION
etc,etc

If I have some free time I'll attach a patch for this.  May be a while though.
Comment 10 Jon Stanley 2008-04-23 16:29:50 EDT
Adding FutureFeature keyword to RFE's.
Comment 11 Parag AN(पराग) 2010-01-28 01:12:40 EST
Retired this package from Fedora rawhide/13 now. Sorry to say but I have no time to test changes needed here.

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