Image game: don't show images included by templates

Issue #77 new
Waldir Pimenta created an issue

For example Item Q16490662, corresponding to ptwiki article Aníbal Freire da Fonseca, shows up in the game with this image suggestion, which is actually an image from a navbox template included in that page.

In general template images aren't specific to the pages the templates are transcluded to (that's the whole point of templates) so they should be excluded from the game.

Comments (2)

  1. Magnus Manske repo owner

    There is no way to determine from the database if an image is on a page through a template or "directly". Also, images from templates include images in infoboxes, which we definitely want to show. Images "hardcoded" in templates could be excluded, but many templates have their text (and images) in <include_only>, so the images won't show up as used in the template.

    What I am doing is removing images that are candidates in >= 8 items. I could probably reduce that number. This does filter out often-used images.

  2. Waldir Pimenta reporter

    The case I mentioned (and another that I came across but didn't mention, of an icon that clearly was part of a template) was an image that was hardcoded in the template. If those could indeed be excluded, it would help :)

    By the way: when you say «There is no way to determine from the database if an image is on a page through a template or "directly"», are you talking about the type of markup used to embed the image, or merely an imagelinks table (I'm just guessing, I don't know the database schema)? I'm saying this because I would expect the filename to appear in the wikitext of the article if the image is included either in an infobox-like template, gallery, or using the [[File:]] wikimarkup, and since the wikitext is available in the database, that should be (I suppose) detectable. When the filename of an image doesn't appear in the wikitext, almost certainly that image isn't specifically tailored to that page, so it should be ignored.

  3. Log in to comment