Extension:PageImages/sv

Tillägget PageImages samlar in information om bilder som används på en sida.

Målet är att returnera den bäst lämpade miniatyren som associeras med artikeln.

PageImages erbjuder också OpenGraph-protokoll-metadata för artiklar på wikin som tredjeparter såsom Facebook kan extrahera.

Konfigurering
$wgPageImagesDenylist is an array of sources for image denylists. Listed images will never be selected as page images. Examples:

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

The denylist itself should contain wikilinks to files, the rest of the content is irrelevant (and can contain links to other pages). For example:

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

$wgPageImagesDenylistExpiry determines how long the list will remain cached, in seconds. Default: 15 * 60 (15 minutes).

$wgPageImagesExpandOpenSearchXml if set to true, PageImages will override the image detection in the  API module with its own, more accurate results. Default: false.

$wgPageImagesNamespaces is an array of namespaces PageImages will be activated on. Default: NS_MAIN.

After the change, you'll have to run to generate the Page image information for those namespaces (hopefully, you can use the --namespace parameter to process only pages on the affected namespaces, since that script is very resource-intensive)

$wgPageImagesOpenGraph enables or disables the OpenGraph meta tags (could be useful if other extensions manage these tags). Default:

$wgPageImagesOpenGraphFallbackImage is a URL to fallback image that will be shown when there is no image on a page. Default:

Upgrade to MediaWiki 1.37+ notes

 * Since MediaWiki 1.37,  and   have been renamed to   and   respectively. There's no backwards compatibility code added to accept the old variable names, which means you should change the variable names during the upgrade, or define both variables in advance in preparation for the upgrade.
 * Since MediaWiki 1.37, the default page value for  has been changed from   to  . If you've added content to   on your wiki, you should rename it during the upgrade. If you want to prepare in advance for the upgrade, you can rename the page to the new name, and also set   (the old variable name) to the new page name, and the default value will be used when upgrading, which should match your previous change.

API
Tillägget PageImages erbjuder bildinformation genom att lägga till en  till -API:t för.

Svar


Exempelbegäran


Hur fungerar det?
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.

How can I check which image is associated with a page?
Page images will be listed on the  page.

How does it select images?
All images in the page are collected and a score for each image is calculated. The image with the highest score is selected as the page image. If the wiki is configured such that images contain metadata that specifies images are not freely licensed, the image with the best score that is also freely licensed is also stored. If no suitable image is found or all the images score badly (i.e. has a negative score), the page will not have any images.

If $wgPageImagesLeadSectionOnly is true, only images in the lead section will be considered. Currently it is true for only Wikipedia projects, all other projects can pull images from outside the lead.

How are images scored?
The best possible page image on Wikimedia wikis is one of the first four images in an article which has a width/height between 400-600px and a height/width which is twice the value of the other dimension.


 * The algorithm is configurable.
 * Scores are calculated by a combination of:
 * Image widths as defined in
 * In Wikimedia wikis, images smaller than 119 pixels are weighted highly negatively. Images with widths between 400px-600px are favoured, with a preference for the lower bound.
 * Images inside galleries are scored separately using
 * In Wikimedia wikis gallery images which are smaller than 100 are disregarded.
 * Position in document is also considered as defined in
 * On Wikimedia wikis, only the first 4 images that appear in the document are considered.
 * The ratio of the image's width to height is considered
 * On Wikimedia wikis a ratio of 0.4 to 3.1 is allowed, with 0.6 to 2.1 preferred. Any other images will score negatively and be discarded.



Hur uppdateras sidbilder?
PageImages fyller på med bilder när -kroken körs, dvs. när en sida redigeras.



Kan jag utelämna vissa sidbilder?
Ja!

För hela wikin finns det en sida som administratörer kan redigera på MediaWiki:Pageimages-denylist (exempel). Alla bilder som ligger där kommer inte användas som sidbilder för artiklar.

För specifika sidor kan man lägga till  till alla bilder som ska utelämnas. Exempelvis,. Fler detaljer finns på T301588.



Hur man jag se en sidas sidbild?
Med hjälp av länken  i sidospalten (eller genom att lägga till  i webbadressen) kommer du se det nuvarande bildvalet.



Hur kan jag rensa en dålig bild?
The pageimage only changes when a link in an article changes. For emergencies, please add/remove links from the page, reverting if necessary. Purging will not work. For larger emergencies please file a Phabricator ticket.

Why is my page image a blank box?
This likely relates to video content in your article. If a video file begins with a blank screen, that will become the default thumbnail for the video and if used as the page image, it will become the page image. We are currently working on a fix for this, that will allow you to change the default thumbnail of a video. Läs: phab:T92457 och phab:T22647 för mer information.

