Page MenuHomeMiraheze

Issue with page image on NU: carnival Wiki
Closed, InvalidPublic


Hi, I have an issue with page image. On NU: carnival Wiki, somehow not all articles have page image.
So no image is displayed when users search for the article when there are images, of course, on the article.
You can check the articles under Category:Allies and Category:Events with scenes for example.

So, is there anything that we can do here?
I saw on MediaWiki help, we can add class=notpageimage to make an image not selected as the page image.
Can we do the opposite? It's great if we can also force a certain image of the page (especially the one from the infobox) to be selected.


Event Timeline

Universal_Omega claimed this task.

Per the documentation:

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 $wgPageImagesScores['width']
      • 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 $wgPageImagesScores['galleryImageWidth']
        • In Wikimedia wikis gallery images which are smaller than 100 are disregarded.
    • Position in document is also considered as defined in $wgPageImagesScores['position']
      • 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 $wgPageImagesScores['ratio']
      • 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.

This means that if the score for your images is to low (and I don't know what it needs to be or what your score actually is) then images are discarded/not used as the page image. So if there is no image meeting the criteria score on your pages, then no page image will be returned. Looking at one of your pages, I can tell that it is likely that the dimensions of the images there make them never be selected as the page image, as seen on the ?action=info of that page, there is no page image. But looking at another page, it does have a page image, because the dimensions of at least one image there actually meets the score criteria.

Since as far as I can tell, this seems to be intentional behaviour of PageImages, I am going to go ahead and close this task as invalid, since we are not able to take any action here. Thank you!

I see. So, it means that there's nothing to do from Miraheze side, right? For the feedback so we can force a certain image to be selected, maybe I should post it on Wikimedia Phabricator instead. What do you think?

Anyway, do you know the current value of this $wgPageImagesScores on Miraheze? The documentation only mentions the default value on Wikimedia wikis. Are they the same?