2013/8/20 Jean-Frédéric <jeanfrederic.wiki(a)gmail.com>
Hi Bastien,
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.…
Where does the "/2/24/" comes from? (The rest of the URL seems
to follow a regular pattern.)
On wiki, you may use [[Special:FilePath]]
<
https://commons.wikimedia.org/w/index.php?title=Special%3AFilePath&file…
Using the API, I *think* imageinfo is what you are looking for (but there
might be a better way):
<
https://commons.wikimedia.org/wiki/Special:ApiSandbox#action=query&prop…
Or you can use thumb.php, eg.
http://commons.wikimedia.org/w/thumb.php?f=Example.jpg&width=100
Anyway, here is map that will be used in Polish contest:
http://wikizabytki.pl/mapa. I think it should work worldwide.
--
*Paweł Marynowski*
Koordynator konkursu Wiki Lubi Zabytki
Stowarzyszenie Wikimedia Polska <http://pl.wikimedia.org/>