SANEのインストール
ここでは、最新のportsを使って「sane-backends-1.0.4」と「sane-frontends-1.0.4」をインストールする手順を紹介します。
GLIBライブラリ、GTKライブラリのインストール
- SANEのインストールに先立って、必要なGLIBライブラリとGTKライブラリをインストールします。ライブラリは、ftp://ftp.gimp.org/pub/から入手します。GLIBを先にインストールする必要があります。
# cd /tmp
# tar zxvf glib-1.2.10.tar.gz
# cd glib-1.2.10
# ./configure
# make
# make install ->これで/usr/local/lib/libglibができます
# cd /tmp
# tar zxvf gtk+-1.2.10.tar.gz
# cd gtk+-1.2.10
# ./configure
# make
# make install ->これで/usr/local/lib/libgtk,libgdkができます
|
最新portsのダウンロード
- 新たに「/usr/ports/graphics/sane-backends」デレクトリを作ります。そこに、sane-backendsの最新portsをftpサイト(ftp://ftp.jp.FreeBSD.org/pub/FreeBSD/ports/ports-stable/graphics/sane-backends/)からをダウンロードします。ダウンロードは、ftpコマンドを使ってかまいませんし、Netscapeでftpアクセスして右クリックメニューから保存してもOKですが、詳細な手順は省略します。
- 同様に「/usr/ports/graphics/sane-frontends」デレクトリを作ります。そこに、sane-frontendsの最新portsをftpサイト(ftp://ftp.jp.FreeBSD.org/pub/FreeBSD/ports/ports-stable/graphics/sane-frontends/)からをダウンロードします。
コンパイルとインストール
- 次に今ダウンロードした最新portsにより、make&installをします。まず、sane-backendsをインストールします。
# cd /usr/ports/graphics/sane-backends
# make install
>> sane-backends-1.0.4.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
>> Attempting to fetch from ftp://ftp.mostang.com/pub/sane/.
(以降略)
|
- 次に、sane-frontendsをインストールします。
# cd /usr/ports/graphics/sane-frontends
# make install
*** Note: xscanimage can be built with a standalone
*** X scanner interface as well as a GIMP plug-in.
*** If you wish to do this, hit Ctrl-C now and use
*** "WITH_GIMP=yes"
>> sane-frontends-1.0.4.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
>> Attempting to fetch from ftp://ftp.mostang.com/pub/sane/.
(途中略)
Congratulations, SANE-FRONTENDS is now installed.
If you built it with GIMP packages/ports installed, you can use
xscanimage as a GIMP plug-in. To do this, type:
ln -sf /usr/local/bin/xscanimage ~/.gimp-1.2/plug-ins/xscanimage
Then run the GIMP, and a new "Acquire Image" menu item should appear in the
"Xtns" menu. Use this to access your scanner.
Have fun!
===> Compressing manual pages for sane-frontends-1.0.4_1
===> Registering installation for sane-frontends-1.0.4_1
|
- 以上で、インストールは終了です。
SANEの設定
- まず、SCSI接続されているフィルムスキャナの認識状態をdmesgで確認します。以下の表示から「pass3」として認識されている事が判ります。
# dmesg | more
(途中略)
Waiting 15 seconds for SCSI devices to settle
(probe3:sym0:0:3:0): phase change 6-7 6@03ee9b8c resid=4.
pass3 at sym0 bus 0 target 3 lun 0
pass3: Fixed Processor SCSI-2 device
pass3: 3.300MB/s transfers
(以降略)
|
- 次に、デバイスファイルがある事を確認します。「pass3」の他にCAM SCSIコンントロール用に「xpt0」デバイスを使用するので、両方のデバイスが存在する事を確認します。
# cd /dev
# ls -l pass*
crw------- 1 root operator 31, 0 4/ 1 04:17 pass0
crw------- 1 root operator 31, 1 4/ 1 04:17 pass1
crw------- 1 root operator 31, 2 4/ 1 04:17 pass2
crw------- 1 root operator 31, 3 4/ 1 04:17 pass3
# ls -l xpt*
crw------- 1 root operator 104, 0 4/ 1 04:17 xpt0
crw------- 1 root operator 104, 1 4/ 1 04:17 xpt1
|
- 標準状態では「pass3」と「xpt0」のデバイスはいずれもrootユーザ以外は使用できません。これでは使い勝手が悪いので、全てのユーザが使用できる様にします。
# chmod go+rw /dev/pass3 /dev/xpt0
# ls -l pss*
lrwxrwxrwx 1 root wheel 4 4/24 23:38 pss -> pss0
crw-rw-rw- 1 root wheel 30, 9 4/24 23:38 pss0
hiroshi# ls -l xpt*
crw-rw-rw- 1 root operator 104, 0 4/ 1 04:17 xpt0
crw------- 1 root operator 104, 1 4/ 1 04:17 xpt1
|
- 次に、「/usr/local/etc/sane.d/」デレクトリ中の使用するスキャナに対応するファイルを編集します。今回は、HPのスキャナに対応する「hp.conf」を以下の様に修正します。
【/usr/local/etc/sane.d/hp.conf】
(修正前)
scsi HP
/dev/scanner
(修正後)
scsi HP
/dev/pass3 <--scannerを実際のデバイスpass3に書き換えます。
|
- 最後にscanimageコマンドで、スキャナが正常に認識できた事を確認をします。
# scanimage -L
device `hp:/dev/pass3' is a Hewlett-Packard C5100A flatbed scanner
|
xscanimageをGIMPのplug-inとして登録
- xscanimageをGIMPのplug-inとして登録すると、GIMPから直接フィルムスキャンする事ができます(のはずです)。xscanimageをGIMPのplug-inとして登録するするには、sane-frontendsインストール時のメッセージにある様に、以下のシンボリックリンクを張ります。
% ln -sf /usr/local/bin/xscanimage ~/.gimp-1.2/plug-ins/xscanimage
|
- 以降、GIMPを起動すれば、xscanimageをプラグインとして使えるはずなのですが、実は、以下の様にエラーとなってしまいました。現在原因を究明中ですが、まだ解決できていません。とりあえずは、xscanimageでスキャンした後に、GIMPを立ち上げて画像編集(ネガ/ポジ変換等)を行っています。
% gimp &
% /home/hnakamur/.gimp-1.2/plug-ins/xscanimage: GIMP support missing.
LibGimp-WARNING **: gimp: wire_read: unexpected EOF
|
フィルムスキャナ(SANE)へもどる
Copyright (c) 2001 Hiroshi Nakamura. All rights reserved.
|
|