Extension talk:PageImages

About this board

Exclude infobox image from page images

3
Borisenko-ru (talkcontribs)

I`ve got two questions related to the algorithm work for infoboxes:

1. How do I exclude specific infobox image with class=notpageimage if it comes from wikidata (it is used in other languages wikis' infoboxes)? The only way is to delete the image on wikidata page (from the "Image" section). But what if I want to leave it on wikidata and just apply class=notpageimage to let the algorithm choose another picture as page image.

2. How do I exclude specific infobox image with class=notpageimage if the image file name is not in square brackets [[]] but the part of infobox template {{}}?

Bdijkstra (talkcontribs)
  1. You could add a parameter to the infobox template that does that.
  2. Same.
PrimeHunter (talkcontribs)

An image is still displayed with image code like [[File:Example.png]] if the image is taken from wikidata and added by an infobox. The infobox generates the image code and could add an optional parameter to instead say [[File:Example.png|class=notpageimage]]. A more hacky solution is to use the local Special:ExpandTemplates to see the precise code generated by the infobox and then wrap the whole infobox call in a string function which changes the image code to add |class=notpageimage. If the wiki has Module:String then Module:String#replace can be used. It's not pretty and may be unstable if changes are later made to the infobox.

Reply to "Exclude infobox image from page images"

How do I exclude a page from having a page image?

3
V G5001 (talkcontribs)

How do I exclude a page from having a page image?

PrimeHunter (talkcontribs)
V G5001 (talkcontribs)

Is there really no other way? Since I would want to do that for the main page of a wiki, which is wholly comprised of templates, and the images in it may change from time to time.

Reply to "How do I exclude a page from having a page image?"

Any way to make the extension consider just a single image?

2
Marx.FelipeForte (talkcontribs)

In the MediaWiki instance I manage, PageImages produces multiple og:image tags, and in some websites, they all get picked up. Is there any way to make the extension consider only the first image and produce a single og:image tag?

Ciencia Al Poder (talkcontribs)

Looks like it's currently not possible

Reply to "Any way to make the extension consider just a single image?"
70.160.223.43 (talkcontribs)

I'm running the following API call: /w/api.php?action=query&list=categorymembers&cmprop=title|sortkeyprefix&cmnamespace=0&cmtitle=Category:Flower to return a list of articles in the "Flower" category.

With the information in Extension:PageImages#API, since this is using the query action, I can get a list of pageimage information by adding "prop=pageimages" to the url to make /w/api.php?action=query&list=categorymembers&cmprop=title|sortkeyprefix&cmnamespace=0&cmtitle=Category:Flower&prop=pageimages

I was expecting the pageimages for each of the pages but the results didn't change.

Since I had an existing "cmprop" parameter, I also tried adding it there to make /w/api.php?action=query&list=categorymembers&cmprop=title|sortkeyprefix|pageimages&cmnamespace=0&cmtitle=Category:Flower but that didn't change anything either.

Am I able to change the url to get the pageimage information for all the pages in the category?

Ciencia Al Poder (talkcontribs)

You need to use categorymembers as a generator, instead of list, because otherwise you are be requesting the pageimage information from the category instead of the members

70.160.223.43 (talkcontribs)

Thanks, that worked perfectly!

Images included by transcluded template

4
EvilPastaSalad (talkcontribs)

Does PageImages ignore or somehow miss images that are included in a page through translusion via a template?

I've adjusted the "ratio" scores in extension.json such that the ratios of image sizes I normally have are scored positively. But with that update, after re-saving the page, I still can't get &action=info to show me any "page image" property on many of my pages, on pages using templates to write infoboxes, the same the way I can when images are simply included using normal Wikitext.

Is using a template to write the image to the page my problem? Thoughts? Workarounds? Thanks.

Ciencia Al Poder (talkcontribs)

Images included through transclusion of templates work fine for PageImages.

SlyAceZeta (talkcontribs)

I am running into the same issue. Almost every page on my wiki that uses a template powered by Extension:PortableInfobox refuses to select a page image. It doesn't even select another image from the page; it just doesn't select any at all. This is causing Popups/Page Previews to fail for almost every page with a Portable Infobox.

Ciencia Al Poder (talkcontribs)
Reply to "Images included by transcluded template"

images from infoboxes

4
46.211.56.121 (talkcontribs)

Don't displayed images from infoboxes, please hepl to fix this.

217.92.248.228 (talkcontribs)

in extension.json try higher numbers for the first position --> in config --> PageImagesScores -> value -> position.


i want the images of infoboxes to be a page image and it seems working well with these settings:


               "position": [

                   100,

                   -100,

                   -100,

                   -100

               ],

195.138.93.32 (talkcontribs)

Its work, but I use PortableInfobox, and PageImages chose images from templates in infobox, but not the main image. How fix it?

SlyAceZeta (talkcontribs)

Replying here as well as Topic:W30ufufmhj50l9h8 to report the same issue, PageImages seems to completely break when PortableInfobox is used.

Reply to "images from infoboxes"

List of pages without pageimage

2
5.53.113.93 (talkcontribs)

Hello! How to get the list of all pages on wiki that don't have pageimage?

Bdijkstra (talkcontribs)

One way is via a Quarry query such as this one. Registered users can fork the query and adjust it to their wishes.

Reply to "List of pages without pageimage"

Looking for a solution with smaller-ish images

2
Blinkingline (talkcontribs)

Hi, On our wiki, a lot of our images are 150 x 150 images, and we'd like to get these considered to be page images for articles.

I've looked at the setting for width, but I'm not sure exactly what kind of scoring I should set for that. Would something like this work?

$wgPageImagesScores['width']= {

"119": -100,

"150": 11,

"400": 10,

"600": 5,

"601": 0

};

PrimeHunter (talkcontribs)
Reply to "Looking for a solution with smaller-ish images"

Page Previews rejects small page images

1
PrimeHunter (talkcontribs)
Reply to "Page Previews rejects small page images"

I can't get this to work.

5
Summary by Gunnar.offel

Array format as described.

SungHerSong (talkcontribs)
PrimeHunter (talkcontribs)
SungHerSong (talkcontribs)

> wfLoadExtension( 'PageImages' );

> $wgPageImagesExpandOpenSearchXml = true;

> $wgPageImagesLeadSectionOnly = true;


$wgPageImagesNamespaces = array( -1 => 0, 0 => 1, 1 => 0,

  2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, 10 => 0, 11 => 0, 3000 => 0, 3002 => 0, 3004 => 0, 3006 => 1, 3008 => 1,

  3018 => 1, 3020 => 1, 3022 => 1, 3024 => 1, 3026 => 1, 3028 => 1, 3030  => 1, 3030  => 1, 3032  => 1, 3034  => 1, 3036  => 1, 3038  => 1,

  3040  => 1, 3042  => 1, 3044  => 1, 3046  => 1, 3048  => 1, 3050  => 1, 3052  => 1, 3054  => 1, 3056  => 1, 3058  => 1, 3060  => 1,

  3062  => 1, 3064  => 1, 3066  => 1, 3068  => 1, 3070  => 1, 3072  => 1, 3074  => 1, 3076  => 1, 3078  => 1, 3080  => 1, 3082  => 1,

  3084  => 1, 3086  => 1, 3088  => 1, 3090  => 1, 3094  => 1, 3096  => 1, 3098  => 1, 3100  => 1, 3102  => 1, 3104  => 1, 3106  => 1,

  3108  => 1, 3110  => 1, 3112  => 1, 3114  => 1, 3116  => 1, 3118  => 1, 3120  => 1, 3122  => 1, 3124  => 1, 3126  => 1, 3128  => 1,

  3130  => 1, 3132  => 1, 3134  => 1, 3136  => 1, 3138  => 1, 3140  => 1, 3142  => 1, 3144  => 1, 3146  => 1, 3148  => 1, 3150  => 1,

  3152  => 1, 3154  => 1, 3156  => 1, 3158  => 1, 3160  => 1, 3162  => 1, 3164  => 1, 3166  => 1, 3168  => 1, 3170  => 1, 3172  => 1,

  3174  => 1 );


I also tried the following, which didn't work.


$wgPageImagesNamespaces[] = 3036;

PrimeHunter (talkcontribs)

Try to merely list the wanted namespaces: array(0, 3006, 3008, ..., 3036, ...)

SungHerSong (talkcontribs)

Alright, I figured it out. The array didn't work, possibly for the reason you mentioned.


However, the second formatting did work. I just forgot I needed to edit the page before it would work. It's working now.