Manual:$wgAllowExternalImages/ja

インラインの画像が、外部のウェブサイトにホストされていてもよいかどうか決定します. 場合によって直リンク（じかリンク、ちょくリンク）とも呼ばれます.

詳細
に設定すると、外部のウェブサイトから取り入れた画像をインラインに利用することができます. 手順はウィキ文中に完全形のURLを差し込むだけです（左右を挟むマークアップは一切不要）. これは外部サイトにある画像の情報源への直リンクです.

に設定すると、完全版のURLの文字列が画像のリンクとして表示されます.

注記：この値をfalseに設定する代わりに、もし単一の信頼できる情報源（例えば自分自身のドメイン）にある複数の画像を使いたい場合は、外部サイトの画像に関する$wgAllowExternalImagesFromを使用します.

例
ウィキ文を使用すると：

処理後の表示： https://en.wikipedia.org/upload/b/bc/Wiki.png

外部画像のサムネイル
サムネイル画像は、MediaWikiのデータベース上の寸法の情報に従ってアップロードした画像から生成されます. 外部画像はMediaWikiデータベースに登録されていないため、サムネイル画像が生成されません.

もしこれらの画像のアップロード先がその他のMediaWikiあるいはユーザーのサイト上のどこかで、MediaWikiによりサムネイルの生成を認めたい場合は、外部画像を有効にする代わりに共有アップロードパス定義をtrueに設定し、共有アップロード先のパスおよび共有アップロード先のデータベース名を指定します.

外部画像を許可する理由とは？
画像の直リンク先のURLを取得する方法を知っているユーザーであれば、インターネット空間上にある画像の情報源からウィキの記事に挿絵を追加するのに便利な方法かもしれません.

この機能がない場合、ユーザーは記事に直接、埋め込んで使いたい画像をいちいちアップロードする義務を負わされます. アップロードするには（多くの場合）手順が多く時間もかかりがちです. もちろんウィキのウェブサーバ上のディスク空間および帯域を消費してしまいます. インライン画像には多くの正当な用途があります.

前述に加えて、この機能は時間の経過とともに変化する もしくはリクエストに応じて生成される、例えば監視ソフトのCactiの出力結果など、拡張子から画像だと判別できるものであれば、外部画像の埋め込みを可能にします. 埋め込みを有効にすると、さらに [Link_URL Embedded_Image_URL] という構文の使用で埋め込み画像のリンク生成も可能になり、画像をクリックするとLink_URLに飛ぶことができます.

(MediaWiki will only recognize image URLs with image file extensions; you may need to add a 'fake' parameter to the end of some URLs, like "&junk=junk.png" or "?.png" to force the parser to realize the Image_URL actually points to an image, so that it will embed it.)

Why disallow external images?
Inline external images are disallowed on across many wikimedia projects, and MediaWiki has AllowExternalImages set to false by default since version 1.6.9. The reasons for this are:

To prevent malicious gathering of browser data. Every time your browser fetches an image (or a web page for that matter) it also submits various bits of data to the webserver in its request. This includes your IP address, the URL of the page you were looking at (the wiki site), and cookies (information about previous requests to that same webserver).

Now with external images enabled, a user can be fetching images from other webservers. A malicious (or devious) person could make wiki edits to set up an external image URL on your wiki, purely for the purpose of gathering this data about your visitors. No need to panic! They wouldn't get credit card numbers or anything, just the kind of data that is sent every time you visit a website. But this might allow them to build up a (rather fuzzy) picture about visitors to your site, which might be correlated with similar data from other sites, and could potentially give rise to privacy concerns. It's the kind of data that has a value to marketing companies, a list saying "The person on this IP address is interested in this kind of website"

An image URL added for this purpose, is an abuse of your wiki, which (unless you disallow it) you will need to look out for along with more conventional Wiki Spam attacks. Note that the actual image could be a miniscule 1x1 pixel images, and so as with wiki spam, you won't necessarily see it on the page itself, but you will see the edit on your 'recent changes'. Conventional Anti-spam features (such $wgSpamRegex) will counter these kinds of URL along with normal link spam.

To prevent (or reduce the impact of) certain types of vandalism. People can still upload offensive images to your wiki, but this option will prevent people inline linking to offensive images, which might make that kind of vandalism less prevalent. If you do allow external images, then removing abusive image links is always a matter of a simple wiki edit (followed by whatever conflict resolution/banning action you wish to take)

To prevent "bandwidth theft" from other sites. A wiki administrator might wish to avoid being accused of bandwidth theft due to inline linking.

This is only of concern in cases where your wiki is linking to a web server/host belonging to somebody else, and that person was not involved or consulted in setting up the link (a wiki edit) In that situation the person might object to such links. Of course removing the link is as simple as editing the wiki, but it should be noted that inline linking in this kind of situation is widely regarded as bad netiquette (even if you are very happy to remove on demand).

In many other situations, bandwidth theft is not a concern:
 * There are some websites which explicitly encourage inline linking to images they host (note that sometimes terms & conditions are attached to inline linking e.g. they require a textual link/acknowledgement)
 * A contributor might decide that images they are hosting on their own website could appear on a wiki page, and so they set up the inline link themselves.
 * Often it might be useful to allow inline linking to images hosted on the very same webserver as the wiki (which are just not uploaded into the wiki), or images hosted as part of the same overall project/organisation. (You could use $wgAllowExternalImagesFrom to specify this as an exception instead)

To prevent "link rot". An image on another site may have been valid when a wiki article was originally created, but there is no guarantee that an independent external site will remain up, with the same content at the same URL, in the future. Any change in the design of the external site has the potential to break external links to individual files on that site. The same problem exists for textual hyperlinks of course, but for broken image references you will wind up with an ugly error box if the link is broken.

To ensure you are hosting all resources. You might wish to disallow inline linking in order to ensure that all images resources appearing on your wiki, are available from your wiki. If you have good hosting bandwidth, you might want to make full use of this and avoid any slowdown in browsing experience due to images being fetched from elsewhere. You might also want to ensure you are gathering all the image resources locally, in order to offer up all your content as a download.

For consistency in handling images. Uploaded images are added to a wiki page using a different wiki syntax. Having two different syntaxes and two different approaches to adding images, could cause confusion for some novice users. If you disallow external images, users must always follow the same upload procedure, and use the same syntax. Also it means images always have the same click behaviour (taking you to the image page)

画像のキャプション
外部画像にキャプションをつけるのは簡単ではありません. その対策のひとつにテーブルの利用があります.

関連項目

 * - HTML形式の タグを有効にし、画像のサイズ変更などに便利に使えます. MW 1.17以降で有効
 * - 指定した情報源に限定して外部画像を許可します.
 * - どの外部画像を許可するか、オンウィキのページで指定します.
 * - ウィキメディア・コモンズの画像を使用可能にします.