Hi,
I've been working on the wikipedia data overlay on our site, multimap.com. One of the things we'd really love to do is add thumbnail images to complement the summary text for an article that we display in our infoboxes. However, we're finding it difficult to programatically generate the URLs to specific images from the wiki tag.
For example, how do i get from:
[[Image:Asperger kl2.jpg|thumb|[[Hans Asperger]] to http://upload.wikimedia.org/wikipedia/en/5/57/Asperger_kl2.jpg
My understanding of the URL structure is thumbnails can be requested from either:
http://upload.wikimedia.org/wikipedia/commons/thumb/X/YY/IMAGENAME/SIZEpx-IM... or http://upload.wikimedia.org/wikipedia/en/thumb/X/YY/IMAGENAME/SIZEpx-IMAGENA...
where X is the first character of the md5 hash of the IMAGENAME, YY are the first two characters of the same hash, IMAGENAME is the image name and SIZE is the size you want in pixels.
The issue is with the /en/ or /commons/ part since it seems it can either and I can't tell of a way to know without actually requesting the image to see if it exists.
Is there a single thumbnail URL I can use to get an image no matter if it exists in commons or not? I noticed there's a thumb.php available too but again it doesn't seem to be a single URL endpoint for all images.
Many many thanks for any help.
Regards, Colm
Colm McMullan Software Engineer multimap e: colm@multimap.com t: +44 (0) 20 7632 7700 (switchboard) 165 Fleet Street, London EC4A 2DY [ Map ยป ] Multi Media Mapping Ltd., trading as Multimap / Company number: 03121505 / VAT registration number: GB 671 8051 34 Registered address: Beaufort House, Tenth Floor, 15 St. Botolph Street, London, EC3A 7EE This email is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact us immediately.
______________________________________________________________________ A member of the Multimap Group owned by Multi Media Mapping Ltd., trading as Multimap / Registered in England & Wales. Company number: 03121505 / VAT registration number: GB 671 8051 34 / Registered address: Beaufort House,Tenth Floor, 15 ST. Botolph Street LONDON EC3A 7EE.
This email is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact us immediately. ______________________________________________________________________