This is Where does the chat get the thumbnail on Wikipedia links from? turned into a bug post

Someone was complaining their head felt heavy in chat so I decided to link them to a possible solution:

enter image description here

The butterfly image is located near the bottom of the page; it is the image used for the Psychiatry portal.

There are also other unfortunate examples of image selection, e.g. Engineering.

The picture chosen for Mr. Miyagi is actually of Mr. Han from the 2010 remake.

The criteria for selecting images seems way off, why can't it just select it by the highest image as displayed; not the source image size? If it picked the one with the largest height or width tag in the HTML, that seems like it would be much better. If it uses some Wikipedia API, is there some way to just look at the article's 'source' page to determine it? Does the one-boxifier go out to every image and examine it?

share|improve this question
It is on the page, at the very bottom. It's the picture used for the Psychiatry portal. –  Wipqozn Aug 20 '11 at 16:01
Picking the first image certainly is not the solution. Or do you think this image is a good representation of Anonymous? –  balpha Aug 20 '11 at 16:13
Another bad case is any Greek letter. It shows the Phoenician letter it descended from, rather than the Greek letter that was linked. –  Mechanical snail Feb 15 '13 at 7:45
add comment

4 Answers

up vote 7 down vote accepted

Wikipedia has an API method that attempts to return the best image for a page. It might be worth investigating using that to select the image.

share|improve this answer
add comment

I just did some "random article" clicking on Wikipedia. Of all articles that even oneboxed with an image, the 16th one was the first one where a different image would absolutely have been better.

Wikipedia oneboxes

– and even that one isn't problematic. Yes, there are a few examples where the chosen image is certainly wrong. But until wikipedia has an API that gives you the canonical image for an article, there'll always be some sort of guesswork involved. The infobox suggestion might work, but we'll have to look closer at that before I can say that it's workable; a) we don't look at the HTML, and b) not all pages have an infobox.

Bottom line: tweaking is certainly a thing we can do, but it has to be within reason. It's not like this is a problem of extraordinary magnitude, and (unless we stop showing images altogether), there'll always be wrong choices.

share|improve this answer
Not that I'm sure this is an issue worth the developer time, but how about letting the user choose when they create the link? It's how Facebook does it, and it works nicely. –  Pëkka Aug 20 '11 at 17:25
How about if you simply picked the first image in the HTML after <img class="thumbimage" ? That would be a huge improvement. To be honest, people are complaining about this all the time in English chat. Consider subtle but all the more misleading errors like this one: Protura. It would be really cool if this could be fixed at some point! –  Cerberus Jan 13 '13 at 4:37
Here is another example: Middle Earth is an happens all the time, almost every other picture is wrong that we see in EL&U. –  Cerberus Jan 14 '13 at 4:17
@Cerberus Let's stay with the truth, okay? –  balpha Jan 14 '13 at 8:39
@balpha: Okay, perhaps not every other picture...but it feels like every other! hands on hips Perhaps we should make a Greasemonkey script, then. Shouldn't be hard, I think (except that I'm a total layman). –  Cerberus Jan 14 '13 at 10:17
add comment

It's not a perfect solution, but I'd suggest that if the page contains an infobox, which in turn contains an image, that one should take precedence.

The infobox is always denoted by <table class="infobox" ...>

That would have produced a correct or at least reasonable selection for all of the subjects mentioned so far, including balpha's Anonymous counterexample in the comments.

Failing that, it's pretty much luck of the draw.

share|improve this answer
add comment

Linking to The Treachery of Images gives a picture of a neuron, rather than the main image in question:

Ceci n'est un neurone.

The Treachery of Images The Treachery of Images (La trahison des images, 1928–29, sometimes translated as The Treason of Images) is a painting by the Belgian René Magritte, painted when Magritte was 30 years old. ...

This is not a pipe.

share|improve this answer
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .