Page MenuHomePhabricator

PageImages ignores images included in Template:Infobox on cswiki
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

What should have happened instead?:

Other information (browser name/version, screenshots, etc.):

The problem isn't limited to the Android OS wikipage, it happens on many other pages. It seems certain infobox
images are somehow ignored.

For example:
https://en.wikipedia.org/wiki/Windows_10 – enwiki API returns desktop screenshot as the pageimage.
https://en.wikipedia.org/wiki/Android_(operating_system) – enwiki API returns logo as the pageimage.

Whereas:
https://en.wikipedia.org/wiki/Windows_10 – cswiki API returns nothing.
https://cs.wikipedia.org/wiki/Tu%C4%8D%C5%88%C3%A1k_osl%C3%AD – cswiki API returns the map (2nd image) instead of the 1st big picture of a beautiful, bold penguin.

Event Timeline

Aklapper renamed this task from Incorrect PageImages extracted on cswiki to PageImages ignores images included in Template:Infobox on cswiki.Feb 14 2023, 11:33 AM
Jdlrobson subscribed.
NOTE: This extension is under code stewardship review and not actively maintained (T252249). No new feature requests will be considered during this period, only security-related fixes.

I think what is happening here is the second image is preferred because of its resolution. https://www.mediawiki.org/wiki/Extension:PageImages#How_does_it_select_images? has some details on the algorithm.
You could probably add class=notpageimage to the selected image to force it to choose the first one.

Wow, thanks! I wasn't aware of this option, works like a charm. However, could you please help me figure out how to use this feature here? https://cs.wikipedia.org/wiki/Tu%C4%8D%C5%88%C3%A1k_osl%C3%AD

As the map is inserted using a specialized infobox field, adding the class you suggested didn't do anything. When I tried to used the full [[File:blah.jpg]] template, it didn't work either. 🤷‍♂️

And as to the first part of your answer, not actively maintained means something like deprecated? Is it being replaced by another API that provides the same functionality? Or does the code stewardship review just mean that it requires an extensive code review and it may in the future be actively maintained again?

@Soustruj you'l need to make an edit (or edit request) to https://cs.wikipedia.org/w/index.php?title=%C5%A0ablona:Taxobox&action=edit
I think it should be a case of changing
[[Soubor:{{{mapa rozšíření|{{#invoke:Wikidata|getRawValue|property=p181}}}}}
to
[[Soubor:{{{mapa rozšíření|class=notpageimage|{{#invoke:Wikidata|getRawValue|property=p181}}}}}

hope that helps!

Jdlrobson claimed this task.

Thanks @matej_suchanek that should do it!

And as to the first part of your answer, not actively maintained means something like deprecated? Is it being replaced by another API that provides the same functionality? Or does the code stewardship review just mean that it requires an extensive code review and it may in the future be actively maintained again?

It just means code review (particularly for any new feature requests) is going to be a lot slower :-(. It's not deprecated - it just doesn't have a team focused on its development right now.

Oh, thanks a lot!

Thanks @matej_suchanek that should do it!

And as to the first part of your answer, not actively maintained means something like deprecated? Is it being replaced by another API that provides the same functionality? Or does the code stewardship review just mean that it requires an extensive code review and it may in the future be actively maintained again?

It just means code review (particularly for any new feature requests) is going to be a lot slower :-(. It's not deprecated - it just doesn't have a team focused on its development right now.

OK, thanks for clarification. 😊