On 20/08/13 19:53, Bastien wrote:
Still far from usable, but I made some progress:

   http://wlmmap.herokuapp.com/

The next step is to implement a proper drop-down menu
for the srcountry, and to display a better pop-up.

Given an image file name, how do you programmatically
retrieve the permalink?

E.g. given Kohila_vesiveski2.jpg I can easily infer
http://commons.wikimedia.org/wiki/File:Kohila_vesiveski2.jpg
but not

http://upload.wikimedia.org/wikipedia/commons/thumb/2/24/Kohila_vesiveski2.jpg/320px-Kohila_vesiveski2.jpg

Where does the "/2/24/" comes from?  (The rest of the URL seems
to follow a regular pattern.)

The first two bytes of the hex representation of the filename md5 (after space→underscore transformations). If the file is smaller than 320px width there may be no 320px thumbnail for you (it may be possible to have a html fallback to the full file in that case).

_______________________________________________
Wiki Loves Monuments mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikilovesmonuments
http://www.wikilovesmonuments.org

Reply via email to