What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

Starting here, we kind of wondered how the chat selects the preview picture. But with this, we changed our direction: where does the chat get these pictures from? The displayed pyramids picture is nowhere to be seen on the page itself (unless I overlooked something)!

share|improve this question
1  
The image is listed as "in use" by the Isis article: en.wikipedia.org/wiki/File:All_Gizah_Pyramids.jpg I can't see where, though, not even in older versions –  Pëkka Jun 12 '11 at 12:45

3 Answers 3

up vote 6 down vote accepted

It just picks the largest (to be precise, tallest) image on the page as returned by Wikipedia's API – and that particular image, even if only displayed as a tiny thumbnail, has a height of 2906 pixels.

In most cases, the largest image is a good representation of the Wikipedia article (I tested a lot); in this case, it's so-so. I've seen worse, though: The image for the Wolfgang Petry article is a picture of Johann Sebastian Bach – but you probably have to be German to “appreciate” that :)

We're now using Wikipedia's PageImages API; see my updated answer here.

share|improve this answer
    
So it inspects the image quite a bit, eh? Thanks. –  Xeo Jun 12 '11 at 14:05
    
What happens if multiple images have the same, tallest height? –  FredOverflow Jun 12 '11 at 15:31

There is hidden (display:none) picture for that in the Wikipedia page source:

<tr>
    <td class="navbox-abovebelow"
        style="background-color:#decd87;"
        colspan="3">
        <a href="/wiki/File:All_Gizah_Pyramids.jpg" class="image">
        <img alt="All Gizah Pyramids.jpg"
             src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/af/All_Gizah_Pyramids.jpg/30px-All_Gizah_Pyramids.jpg"
             width="30"
             height="20" />
        </a>
        <a href="/wiki/Portal:Ancient_Egypt"
           title="Portal:Ancient Egypt">
        <b>Ancient Egypt Portal</b></a>
    </td>
</tr>

If you click show on the right corner of that block, you would see that picture :D

Enter image description here

share|improve this answer
1  
Was just about to post this. I don't understand what the meaning of this is, though - the image has no rel attribute, no nothing... Doesn't look clean to me –  Pëkka Jun 12 '11 at 12:47
2  
We found out that it is unhidden by clicking [show] on the bar at the bottom of the page, reading "Ancient Egyptian religion". It is a really tiny image at the bottom of the expanded area. –  Xeo Jun 12 '11 at 12:50

It seems to be extracting the image from the last HTML <a> tag with the attribute image="class" on the article.

share|improve this answer

You must log in to answer this question.

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