Monday, February 9, 2009

Xsane in the OSX brain

Using a Scanner with OSX

My brother is getting married in July so i thought i'd scan all the old photos and create a movie. There are 2 scanners - the Canon usb one is hooked to //godzilla, a Ubuntu 8.04 box and the other is a big HP scanjet scsi model hooked up to //rodan, a windows 2003 server that is due to retire sometime soon.

Rather than scan and move files around i decided to hook a scanner to //mothra, a dual G5 running osx 10.4 and pulled out the almost identical canon canonscan N650U which is a usv scanner. I once tried to hook it up to windows but it complained about drivers etc. so it has been sitting around collecting dust.

We plug it into the G5 and it does show up in the 'About this mac' but there is no way to operate it. So off to the canon site where there is some downloads, apparently a driver download and the canonscan software. We download and try to install. No joy - the canon software cannot find the canon scanner. Reading around the net we discover this situation is still very common with osx and scanners. What's the solution?

Well on the Ubuntu box we plugged in the canon scanner and it picked it up and we scanned stuff with Xsane. No install, no problem = it just works. Hey wasn't that supposed to be windows big thing? Well it worked in ubuntu and not in windows. So, can we use the open source SANE software on osx?

We check the list of supported sane devices at: http://www.sane-project.org/sane-supported-devices.html and the canoscan n650u is listed as 

ModelInterfaceUSB idStatusCommentBackendManpage
Cano
Scan
N650U
N656U
USB0x04a9/0x2206CompleteNA plustek 
(0.52)
sane-plustek

We find osx binaries at http://www.ellert.se/twain-sane/ and download them. First we extract the pkg files from the zipped tarballs. We now have the following:

  • gettext
  • libusb
  • sane-backends
  • twain-sane interface
  • sane-preference pane
And we install them in that order. We now check the system preferences and there is SANE in the other section. Clicking brings up a list of drivers for many models - we uncheck all but the canon and the plustek. We do not activate scanner sharing.

Off to applications to run image capture which says 'no image capture device connected'. We select Devices, Browse Devices, TWAIN devices from the menu. SANE is shown as an option so we select it. Do we tick the Use TWAIN software box? Ok we will tick it and see. Now we click CONNECT. Put a photo on the plate and click SCAN. Now we have some options. We select 14 bit color at 1200 dpi. Nice to see the CanoScan as the image source! We click SCAN but get an error during device I/O.

We should test this with a known working scanner. Off we go to get the other canon usb scanner. Ok the scanner we were using may have had a problem. Let's try the canon something - it doesn't seem to have a model number but is almost exactly the same.

Back to image capture and we try Devices, Sane, Overview to see if we can get a preview. The scanner makes a little noise and it takes a minute but then it starts scanning. But not scan.jpg is found in the pictures folder and no preview. Try again. The SCAN button is still grayed out.

Ok the scanner is in fact a canon 630U and now the SCAN button is there - i had to reboot to get everything working. I wasted another hour trying the canon software and driver which did not work. The SANE twain is a bit slow to make the scan - not its fault i think, probably due to the weird way twain is implemented in osx. 

Summary and Conclusions

In this test of installing a 'plug n play' USB device - namely a common scanner on Windows, OSX and Linux, the easiest OS was...Linux.  Ubuntu 8.04 picked up the scanner without installing drivers and i was able to scan immediately using XSANE. When plugged into windows the scanner/camera wizard could not find the scanner. I went to the canon site but and there was software there for XP but since i don't want to use windows anymore i decided not to download and install. I next tried osx and did download and install the manufacter's software which did not work. This is not to say it would never work - just that it was not an easy or obvious thing. Finally, i tried the open source SANE and it worked. Chalk one up for open source.


No comments: