bar_1

contents_map

2016年11月17日木曜日

Mac の GIMP 2.8.18 でインストール版の日本語のヘルプを使うには

以前(2014年)Mac の GIMP 2.8.10 向けに、同様のことをおこなう方法を書きました。それから時が経ち、GIMP に組み込まれている GTK の仕様が若干変わったことから、以前書いた方法では、うまく行かなくなってしまったようです。
そこで試行錯誤したところ、新たに GIMP 2.8.18 でインストール版の日本語のヘルプ (= GIMP User Manual; 使用のてびき) や状況適応ヘルプ、今日の技を見るための解法を見つけることができたので、本記事として取り上げたいと思います (オンライン版の日本語ヘルプを使いたい人は、以下の作業は必要ありません。GIMP を起動してからヘルプの設定で オンライン版 を選べば問題なく利用できます)。


試した環境

不具合の現象

GIMP 2.8.18 でインストール版のヘルプを見ようとすると、以下のようなエラーメッセージが表示され、利用できない:
GIMP エラーメッセージ

プロシージャー 'plug-in-web-browser' の呼出し時にエラーが発生しました。
No application is registered as handling this file

解法

大きな流れは以下の2ステップです:
  1. GIMP の日本語のヘルプドキュメントのデータを GIMP.app に組み込む
  2. GIMP の中の GTK の MimeType の設定

1. GIMP の日本語のヘルプドキュメントのデータを GIMP.app に組み込む

今回は debian のパッケージを使ってみます。
たぶん、この 2.8.2 というのが GIMP 2.8.18 に対応していると思われる……
ので、まずはターミナルを開いて、なにかてきとうな作業用のディレクトリをつくり、カレントディレクトリをそこに移してください。
そこに gimp-help-ja_2.8.2-0.1_all.deb をダウンロード してきます。ミラーサイトは ftp.jp.debian.org/debian を使えばよいでしょう。
debian のパッケージ形式 .deb は UNIX の標準のアーカイブ形式なんですな。なので、以下のように標準のコマンド (ar, tar) を使って展開できます:
$ ar -vx gimp-help-ja_2.8.2-0.1_all.deb && tar -xvzf data.tar.xz
とします。そうすると、今いる作業用のディレクトリの中に:
usr/share/doc/〜
usr/share/doc-base/〜
usr/share/gimp/2.0/help/〜
というフォルダ (とファイル) たちが展開されます。これら3つのフォルダ (doc/, doc-base/, help/) をそれぞれ GIMP.app の中身となるように、具体的には:
/Applications/GIMP.app/Contents/Resources/share/doc/
/Applications/GIMP.app/Contents/Resources/share/doc-base/
/Applications/GIMP.app/Contents/Resources/share/gimp/2.0/help/
となるように、コピーしてください。Finder からコピペすればいいと思います。
ヘルプデータのコピーができたら、これら日本語のヘルプデータが GIMP に組み込まれたことの確認をします:
  1. GIMP を起動して、メニューの GIMP > 設定(P) を選択し、
  2. GIMP の設定 ウィンドウが表示されたらその中の左のリストから上から4つ目ほどにある浮き輪アイコンの ヘルプ をクリックします。
ここまでの修正がうまくできていれば
  • 使用するユーザーズマニュアル: がインストール版に設定されていること
  • 💡 ユーザーズマニュアルはインストール済みです。 と表示されていること
の2点を満たしているはずです (2016-11-22追記: macOS 10.12.1 (Sierra) 環境では、OSのシステム環境設定「言語と地域」の「優先する言語」の設定が日本語になっていても、うまく認識されないという報告をコメントでいただきました。この場合GIMPの設定からユーザーインターフェース>言語の設定を、既定の値の「システム設定の言語」から「Japanese [ja]」へと変更してみるとうまくいくかもしれません)

2. GIMP の中の GTK の MimeType の設定

コマンドラインから
$ cd /Applications/GIMP.app/Contents/Resources/share/applications/
$ ls
とすると、ここに3つのファイル: gimp.desktop mimeinfo.cache open.desktop があります。このうち、編集するのは今回も、mimeinfo.cacheopen.desktop です。
まずバックアップをとります:
$ cp -p mimeinfo.cache mimeinfo.cache.orig
$ cp -p open.desktop open.desktop.orig
エディタでファイル memeinfo.cache に次の2項目を追加してください:
application/html=gimp.desktop;
x-scheme-handler/file=open.desktop;
(追加する場所は、たぶんどこでもいいと思いますが、わたしは、1つ目の html の項目を2行目の application/pdf=gimp.desktop の下、2つ目の file の項目を30行目の x-scheme-handler/http=open.desktop の上にしました。)
編集が終わったら diff で確認します:
$ diff mimeinfo.cache.orig mimeinfo.cache
2a3
> application/html=gimp.desktop;
30a32
> x-scheme-handler/file=open.desktop;
次にファイル open.desktop の修正です。このファイルの一番最後あたりにある MimeType=ほにゃらら の行に、以下のように application/html;x-scheme-handler/file; を追加します。
MimeType=application/html;x-scheme-handler/file;x-scheme-handler/http;x-scheme-handler/https
編集したら diff で確認します:
$ diff open.desktop.orig open.desktop
7c7
< MimeType=x-scheme-handler/http;x-scheme-handler/https
---
> MimeType=application/html;x-scheme-handler/file;x-scheme-handler/http;x-scheme-handler/https
以上で、Mac の GIMP 2.8.18 でヘルプが見れるようになりました❗ よかったよかった😊

References

22 件のコメント:

  1. 先日のものです。本件試してみたのですが、所定の位置にコピーしてもインストール版の認識がうまくいかない模様です。
    もしや、パーミッションとか変えないとダメとか・・・?

    返信削除
    返信
    1. ステップ1でダメということですか。う〜ん……
      以下について、教えていただけますか?
       a. Sierraの詳しいバージョン
       b. GIMPのダウンロードはどこでしたか
      あと、

      削除
    2. ls -l /Applications/GIMP.app/Contents/Resources/share/gimp/2.0/help/ja/index.html | awk '{ print $1 $9 }'

      の実行結果についてもお願いします(今見たところではわたしの場合-rw-r--r--となってました)。

      削除
  2. すいませんです・・・
    Sierraですが10.12.1です。但し10.11.6から上書きです。
    また、オフィシャルから入手のGIMPを10.11.6の時点で入れておりました。
    (中途半端な初期設定がどっかに残ってる・・・?正直分かってないです。)
    で、今回オフィシャル入手とHomeBrewで
    brew install Caskroom/cask/gimp
    したものと、両方試してみましたが認識しない模様です。
    ヘルプファイルは以下
    https://packages.debian.org/sid/all/gimp-help-ja/download
    から、日本のミラーらしきところで拾ったものです。

    なにか、当方すごい見落としがありそうな気が・・・。

    返信削除
  3. コマンドライン実行結果ですが
    -rw-r--r--/Applications/GIMP.app/Contents/Resources/share/gimp/2.0/help/ja/index.html
    でした。変わってない?

    返信削除
    返信
    1. バイナリ、ヘルプデータともわたしと同じですね。バイナリに関してわたしはbrewは試してないですが。あとヘルプデータについてなんですけど、古い版のhelp/だけ配置しただけでも「インストール済み」として認識されることを確認しております。

      以下のようにコマンドラインから直接起動スクリプトで起動した後は、状況はどうなるでしょうか?
      $ /Applications/GIMP.app/Contents/MacOS/GIMP --verbose --g-fatal-warnings

      削除
    2. それでも認識されていなかった場合、~/Library/Application\ Support/GIMP ←これ(ユーザ固有の設定データのフォルダです)を一時的にGIMP.oldなどとリネームして(つまりユーザ固有のデータが無い状態にして)、もう一度起動スクリプトを実行してみると、どうなるでしょうか。。。?

      削除
    3. あともう一つは、Macのシステム環境設定で、言語と地域>優先する言語の設定は、何になってますかね?

      削除
  4. このコメントは投稿者によって削除されました。

    返信削除
  5. コマンドラインで起動してみました。
    Setting up environment...
    Enabling internal Python...
    Launching GIMP...
    Cannot spawn a message bus without a machine-id: Unable to load /var/lib/dbus/machine-id or /etc/machine-id: Failed to open file '/var/lib/dbus/machine-id': No such file or directory
    INIT: gimp_load_config
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/unitrc'
    Parsing '/Applications/GIMP.app/Contents/Resources/etc/gimp/2.0/gimprc'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/gimprc'
    gimp_composite: verbose=no
    Processor instruction sets: +mmx +sse +sse2 -3dnow -altivec -vis
    Adding theme 'Default' (/Applications/GIMP.app/Contents/Resources/share/gimp/2.0/themes/Default)
    Adding theme 'Small' (/Applications/GIMP.app/Contents/Resources/share/gimp/2.0/themes/Small)
    Writing '/Users/gphidenori/Library/Application Support/GIMP/2.8/themerc'
    Trying splash '/Users/gphidenori/Library/Application Support/GIMP/2.8/gimp-splash.png' ... failed
    Trying splash '/Applications/GIMP.app/Contents/Resources/share/gimp/2.0/images/gimp-splash.png' ... OK
    INIT: gimp_initialize
    INIT: gimp_real_initialize
    INIT: gui_initialize_after_callback
    INIT: gimp_restore
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/parasiterc'
    Loading 'brush factory' data
    Loading 'dynamics factory' data
    Loading 'pattern factory' data
    Loading 'palette factory' data
    Loading 'gradient factory' data
    Loading fonts
    Loading 'tool preset factory' data

    返信削除
  6. Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/templaterc'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/modulerc'
    Loading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libcolor-selector-cmyk.so'
    Unloading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libcolor-selector-cmyk.so'
    Loading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libcolor-selector-water.so'
    Unloading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libcolor-selector-water.so'
    Loading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libcolor-selector-wheel.so'
    Unloading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libcolor-selector-wheel.so'
    Loading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libcontroller-midi.so'
    Unloading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libcontroller-midi.so'
    Loading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libdisplay-filter-color-blind.so'
    Unloading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libdisplay-filter-color-blind.so'
    Loading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libdisplay-filter-gamma.so'
    Unloading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libdisplay-filter-gamma.so'
    Loading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libdisplay-filter-high-contrast.so'
    Unloading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libdisplay-filter-high-contrast.so'
    Loading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libdisplay-filter-lcms.so'
    Unloading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libdisplay-filter-lcms.so'
    Loading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libdisplay-filter-proof.so'
    Unloading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libdisplay-filter-proof.so'
    INIT: gui_restore_callback
    clipboard: writable pixbuf format: image/png
    clipboard: writable pixbuf format: image/bmp
    clipboard: writable pixbuf format: image/x-bmp
    clipboard: writable pixbuf format: image/x-MS-bmp
    clipboard: writable pixbuf format: image/x-icon
    clipboard: writable pixbuf format: image/x-ico
    clipboard: writable pixbuf format: image/x-win-bitmap
    clipboard: writable pixbuf format: image/vnd.microsoft.icon
    clipboard: writable pixbuf format: application/ico
    clipboard: writable pixbuf format: image/ico
    clipboard: writable pixbuf format: image/icon
    clipboard: writable pixbuf format: text/ico
    clipboard: writable pixbuf format: image/tiff
    clipboard: writable pixbuf format: image/jpeg

    返信削除
  7. Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/sessionrc'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/dockrc'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/toolrc'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/contextrc'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-rect-select-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-ellipse-select-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-free-select-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-fuzzy-select-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-by-color-select-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-iscissors-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-foreground-select-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-vector-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-color-picker-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-zoom-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-measure-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-move-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-align-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-crop-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-rotate-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-scale-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-shear-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-perspective-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-flip-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-cage-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-text-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-bucket-fill-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-blend-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-pencil-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-paintbrush-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-eraser-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-airbrush-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-ink-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-clone-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-heal-tool'

    返信削除
  8. Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-perspective-clone-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-convolve-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-smudge-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-dodge-burn-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-desaturate-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-color-balance-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-hue-saturation-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-colorize-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-brightness-contrast-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-threshold-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-levels-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-curves-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-posterize-tool'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/tool-options/gimp-gegl-tool'
    INIT: gimp_real_restore
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/pluginrc'
    Starting extension: 'extension-script-fu'
    INIT: gui_restore_after_callback
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/menurc'
    loading menu '/Applications/GIMP.app/Contents/Resources/share/gimp/2.0/menus/image-menu.xml' for /image-menubar
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/devicerc'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/controllerrc'
    Parsing '/Users/gphidenori/Library/Application Support/GIMP/2.8/colorrc'
    Loading module '/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/modules/libdisplay-filter-lcms.so'

    返信削除
  9. で。このコマンドラインで起動した場合は、なんと表示がインストール済みになるのでありました。なにかありそう・・・?
    そのまま起動するとダメなままです。今から設定フォルダを消してみます。

    返信削除
  10. ダメでした。やっぱりインストールされていないと出ます。
    なお、優先言語は日本語です。

    返信削除
    返信
    1. 私と同じですね。次のコメントの方法で、起動してみてください。

      削除
  11. うーむ、コマンドラインでのVerboseモード?との違いが分かれば・・・ということでしょうか。ヘルプ見るのにネットにつなぐのも癪なのでなんとかしたいですが、何か分かりそうでしょうか。長々とすいません。恐縮至極です・・・。

    返信削除
    返信
    1. なるほど。つまり現状ですと、
      ・コマンドラインから起動する→認識される
      ・そのまま(メニューにあるGIMPアイコンをクリック?で)起動→認識されない

      ここから推察される原因は、メニューのアイコンが、古い(2.8.18ではない)GIMP(もしくはヘルプデータを含まないGIMP)を参照しているのではないか? ということです。

      コマンドラインから起動したときは認識するとのこと。では、画面右下の「書類」アイコンの左にある、「アプリケーション」のアイコン(「A」という水色の四角っぽいアイコン)をクリックして、そこからGIMPを起動すればうまくいくのではないでしょうか。

      削除
    2. ファイルパスを確認しておりますので、参照間違いはない模様でした。
      念のためストレージ階層をたどって起動してみましたが、同様でした。
      手詰まりかなぁ・・・と、思ってたのですが、その時思い出した事。
      「そういえば、初期のネイティヴバージョンやpartha.comの独自ビルドでシステム言語判定に失敗して初期表示が英語になる不具合あったなあ・・・。」

      設定内容の各種でリセットを選びまくって、言語の部分のみJapaneseを設定して、再度起動し直し。

      インストール済み状態に表示が変わりました!万歳。
      時間が遅いので、ファイル書き換えは明日試すことにします。
      Macの日本語指定が独自仕様なのか、前から引きずってる潜在的不具合かは不明ながら、もう少し練る必要があるのかもです>GIMP
      (Windows版でも判定失敗版があった記憶があります)

      削除
    3. なるほど。どうもありがとうございました。
      Sierra上だと、GIMPのユーザーインターフェース>言語の設定>システム設定の言語での判定が、うまく機能していない可能性がありますねぇ。。

      削除
  12. 結局今日中にやってみました(苦笑)
    無事標準Webブラウザで表示されました。

    で、思いついて、「言語判定にしくじるのが根底にあれば、ひょっとすると英語ヘルプだとどうなるか?」

    遣ってみました。debian向けと思われるものから英語ヘルプを拾って同様に配置すると、
    システム言語設定に従うままだと、思った通りでした。英語ヘルプが起動するのであります。

    とりあえず、差し支えなければ遣り方のところに注記を入れていただくといいかもです。
    情報とご協力に感謝いたします。

    返信削除

何かありましたら、どうぞ: