Extension talk:PageImages/Flow

About this board

Manually trigger LinksUpdate on all Aritcles

5
Mojoaxel (talkcontribs)

The Extension works fine and I'm very happy with it. The question now is how to trigger the Plugin on all Articles. At the moment only images are shown after I changes an Article.

Is there a way to trigger LinksUpdate on all Articles manually?

Varlin (talkcontribs)

+1. It would be a basic feature...

46.164.5.51 (talkcontribs)

Hey, it is possible to do it manually. I am currently having MediaWiki 1.31.

To manually trigger this for all articles you have to start the initImageData.php in extensions/PageImages/maintenance/ folder. I do not have shell/ssh support on my provider, so I had to use MaintenanceShell extension and change the $wgMaintenanceShellPath to the mentioned path.

It looks like there is also some problem (at least on my server) with the script and I couldnt get it work properly. After some debugging I saw that I had to change LinksUpdateHookHandler.php (in PageImages/includes/) the following:

$rev = $linksUpdate->getRevision();

with:

$rev = Revision::newFromTitle($linksUpdate->getTitle());

And I managed to get all images on preview (using the Popups/PagePreviews extension)

Hope it helps someone

Pastakhov (talkcontribs)

thanks

80.152.229.133 (talkcontribs)

Just running initImageData.php over shell did the job. THANK YOU!

Warning when running initImageData.php on MediaWiki 1.40

3
MikeDarling (talkcontribs)

I received the below warning when running initImageData.php. It seems to have worked fine, but a note should be added on the Configuration section explaining how to use maintenance/run.php (or if it's safe to simply ignore this warning).

C:\inetpub\wwwroot\mediawiki\extensions\PageImages\maintenance>php initImageData.php

*******************************************************************************

NOTE: Do not run maintenance scripts directly, use maintenance/run.php instead!

      Running scripts directly has been deprecated in MediaWiki 1.40.

      It may not work for some (or any) scripts in the future.

*******************************************************************************

35

done

I'm not sure if this needs to be updated in the extension code itself.

Jdforrester (WMF) (talkcontribs)

We should probably just hook the maintenance script up to update.php like most extensions do?

Jdforrester (WMF) (talkcontribs)
Reply to "Warning when running initImageData.php on MediaWiki 1.40"

images from infoboxes

5
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.

TaylanKammer (talkcontribs)

Can report the same issue. PageImages can't seem to extract images from the topmost <image> of a PortableInfobox.

Reply to "images from infoboxes"

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"

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"
Return to "PageImages/Flow" page.