Extension:PageImages/ru

PageImages расширение собирает информацию об изображениях, используемых на странице.

Его цель - вернуть единственный наиболее подходящий эскиз, связанный со статьей.

API
The PageImages extension provides image information by adding a  to the  API for.

Настройка
$wgPageImagesBlacklist is an array of sources for image blacklists. Blacklisted images will never be selected as page images. Examples:

More than one source can be used at the same time.

$wgPageImagesBlacklistExpiry determines how long the blacklist will remain cached, in seconds. По умолчанию: 15 * 60 (15 минут).

$wgPageImagesExpandOpenSearchXml if set to true, PageImages will override the image detection in the API module with its own, more accurate results. По умолчанию: false.

$wgPageImagesNamespaces is an array of namespaces PageImages will be activated on. По умолчанию: NS_MAIN.

The blacklist itself should contain a wikilinks to blacklisted files, the rest of content is irrelevant (and can contain links to other pages). Например:

Remember that file links that result in images being added to the page will not work (these files are blacklisted for a reason, right?), so don't forget the  in front of the links.

Как это работает
When a page is saved with a local image, the parser runs the hooks  and. The PageImages extension responds to these (and other hooks) and inserts a new property for the page into the table. The property name is  and its value is the name of the image.

The extension only stores the chosen image name. Other features may display the image, such as Page information, Hovercards, and Mobile search while typing.

Выбор изображения
The page image is chosen based on a number of criteria with limited documentation. It attempts to return only meaningful images, e.g. not those from maintenance templates, stubs or flag icons. Non-free images may be skipped for copyright reasons. Images with very different width and height may be skipped due to poor display in features using the image. Можно выбрать первое изображение, удовлетворяющее определенным критериям. На некоторых страницах изображение выбрано не будет.