Also see

http://owl.phy.queensu.ca/~phil/exiftool/

-- 

    Greg Troxel <[email protected]>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: not available
Url : 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20060909/cea0ebb8/attachment.pgp
From [email protected]  Sun Sep 10 10:29:39 2006
From: [email protected] (Taisuke Yamada)
Date: Sun Sep 10 10:29:07 2006
Subject: [sane-devel] [RFC][PATCH] scanimage --batch="| pipe > %d.img"
        extension
Message-ID: <[email protected]>

Hi.

I have created a patch to make "scanimage --batch=" accept
command pipeline in addition to plain filename, and wondering
if this could be merged back to the original. I'm currently
scanning thousands of pages with ADF, and this extension
increases overall processing speed significantly.

Check out the following:

  $ time ./scanimage --batch=%.3d.pnm --batch-count=1
  Scanning 1 pages, incrementing by 1, numbering from 1
  Scanning page 1
  Scanned page 1. (scanner status = 5)
  real    0m14.579s
  user    0m0.088s
  sys     0m0.060s

  $ time ./scanimage --batch='| pnmflip -cw > %.3d.pnm' --batch-count=1
  Scanning page 1
  Scanned page 1. (scanner status = 5)
  real    0m14.931s
  user    0m4.740s
  sys     0m0.160s

  $ time sh -c './scanimage --batch=%.3d.pnm --batch-count=1; pnmflip -cw < 
001.pnm > a && mv a 001.pnm'
  Scanning 1 pages, incrementing by 1, numbering from 1
  Scanning page 1
  Scanned page 1. (scanner status = 5)
  real    0m19.348s
  user    0m4.736s
  sys     0m0.140s

As you can see, doing on-the-fly conversion brings speed
advantage of nearly 25%, and it also reduces both disk I/O
and space requirement by 50%.

This is similar to scanadf extension posted some time ago, but
since scanimage is more flexible than scanadf, it'd be great
if this gets included as well.

Best Regards,
--
Taisuke Yamada <[email protected]>
2268 E9A2 D4F9 014E F11D  1DF7 DCA3 83BC 78E5 CD3A

Message to my public address may not be handled in a timely manner.
For a direct contact, please use my private address on my namecard.

-------------- next part --------------
--- scanimage.c.orig    2006-09-10 13:21:41.000000000 +0900
+++ scanimage.c 2006-09-10 13:21:45.000000000 +0900
@@ -2117,7 +2117,7 @@
        {
          char path[PATH_MAX];
          if (batch)            /* format is NULL unless batch mode */
-           sprintf (path, format, n);  /* love --(C++) */
+           sprintf (path, format, n, n, n, n, n);      /* love --(C++) */
 
 
          if (batch)
@@ -2146,15 +2146,21 @@
            {
              fprintf (stderr, "%s: sane_start: %s\n",
                       prog_name, sane_strstatus (status));
-             fclose (stdout);
              break;
            }
 
-         if (batch && NULL == freopen (path, "w", stdout))
+         if (batch)
            {
-             fprintf (stderr, "cannot open %s\n", path);
-             sane_cancel (device);
-             return SANE_STATUS_ACCESS_DENIED;
+             FILE *tmp = (path[0] == '|')
+               ? popen (&path[1], "w") : freopen (path, "w", stdout);
+
+             if (tmp == NULL)
+               {
+                 fprintf (stderr, "cannot open %s\n", path);
+                 sane_cancel (device);
+                 return SANE_STATUS_ACCESS_DENIED;
+               }
+             stdout = tmp;
            }
 
          status = scan_it ();
@@ -2179,6 +2185,14 @@
                }
              break;
            }                   /* switch */
+
+         {
+           struct stat buf;
+           fstat (fileno (stdout), &buf);
+           if (S_ISFIFO (buf.st_mode))
+             pclose (stdout);
+         }
+
          n += batch_increment;
        }
       while ((batch
From [email protected]  Mon Sep 11 15:37:32 2006
From: [email protected] (pahre)
Date: Mon Sep 11 15:38:01 2006
Subject: [sane-devel] CanoScan N670U/LiDE 20 jamming with FC5
Message-ID: <[email protected]>


I've seen some posts before about problems with this scanner under FC5 (which
appear not always to occur with other distributions).
But the previous posts didn't seem to have a clear solution.
Can somebody please help me out and/or direct me to where a solution is
available?


Canon CanoScan N670U (I believe it is LiDE 20)

Fedora Core 5:  fresh install of /root (not upgrade from previous FC).


Tried with default xsane, scanimage, and then upgraded various packages
related to it.  Same problem throughout:

Jamming of scanner (intermittent, but more often than not)
Both color and gray
Only way out is to unplug USB cable, kill xsane, then plug USB cable and
     restart xsane
Problem occurs sometimes on opening xsane, other times it can be stopped
     by immediately starting a scan.  Also intermittently occurs in the
     middle of scanning a series of pages -- but always at the very
     beginning of a particular scan.  Mechanically:  the pulley in the
     scanner under the window looks to be shaking back and forth a little.
     Nasty noise...  but no smoke (yet).

Kernel has been upgraded:
# uname -a
  Linux essiama 2.6.17-1.2174_FC5 #1 Tue Aug 8 15:30:55 EDT 2006 i686 i686
i386 GNU/Linux
but problem with both kernels.

RPMs after upgrading:

# rpm -qa | grep sane
sane-frontends-1.0.14-1.2.1
sane-backends-1.0.17-5.fc5.9
libsane-hpaio-1.6.6a-1.1
xsane-0.991-1.fc5
xsane-gimp-0.991-1.fc5

I.e., xsane up to 0.991-1 and sane-backends up to 1.0.17.  (No rpm for
FC5 for sane-backends 1.0.18 seems to exist yet in the usual repositories.)


Upon hotplugging the USB scanner:

Sep 11 10:22:59 localhost kernel: usb 2-1: new full speed USB device using
uhci_hcd and address 8
Sep 11 10:22:59 localhost kernel: usb 2-1: configuration #1 chosen from 1
choice

Upon starting up xsane and getting an immediate jam:

Sep 11 10:23:22 localhost python: hpssd [WARN] Inrecognized URI:
usb:/dev/usb/lp0
Sep 11 10:23:22 localhost hpiod: ParDevice::nibble_read failed: Input/output
error

Note the odd lp0 line that comes up -- I do have a printer running at
/dev/usb/lp0 (and fully working).

Note that lampswitch (on and off) seems to work just fine, turning the color
scanning lights on and off (when not jammed).

The scanner works just fine -- I was fully successful with using it under
FC2 with minimal updating of xsane (0.91 or so, if I remember correctly).
I could verify this with MS Windows, but it sounds like other people have
had the same jamming problem with CanoScan under FC5 and reported that their
scanners are fine under MS Windows.  (Yes, I have verified that the travel
lock is not engaged on the scanner.)

Notice that the sane-backends that show up in the documentation page:

       file:///usr/share/sane/xsane/doc/sane-backends-doc.html

does not have a link for sane-canon (unclear if that means that the scanning
mode is working or just
not documented).

Roughly the same problem with KDE kooka:

# kooka --version
Qt: 3.3.5
KDE: 3.5.1-2.3 Red Hat
Kooka: 0.44

which presumably shares the same backend.  Note that on kooka startup, it
has a splash screen
(to select scanner) which seems to have fully recognized my scanner as
CanoScan N670U LiDE 20:

    Select Scan Device:
    1. plustek:libusb:002:012
       Canon N670U/N676U/LiDE20

Notice that the /var/log/messages error:

Sep 11 10:23:22 localhost hpiod: ParDevice::nibble_read failed: Input/output
error

shows up regardless of kooka or xsane -- but also shows up if starting up
kooka and the scanner
is not yet plugged into the USB!

Tried running xsane as root (despite the warnings) -- same problem.


# rpm -qa | grep libusb
  libusb-0.1.11-2.2
Found comment to make sure libusb 0.1.12, so ran yum to update, but no
packages found.
Not sure how important this is -- the scanner appears to be recognized.

cat /etc/udev/rules.d/60-libsane.rules
...
SUBSYSTEM!="usb_device", ACTION!="add", GOTO="libsane_rules_end"
...
# Canon Inc.|CanoScan N670U/N676U/LIDE 20
SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="220d", SYMLINK+="scanner-%k"
...
LABEL="libsane_rules_end"
...


-- 
View this message in context: 
http://www.nabble.com/CanoScan-N670U-LiDE-20-jamming-with-FC5-tf2253141.html#a6249202
Sent from the SANE - Dev forum at Nabble.com.

Reply via email to