In order to obtain a thumbnail URL for a file on Wikimedia Commons, you can use:
- https://upload.wikimedia.org/wikipedia/commons/thumb/5/57/Wikimania.svg/1000px-Wikimania.svg.png (involving md5 computations for /5/57/)
- https://commons.wikimedia.org/wiki/Special:FilePath/Wikimania.svg?width=1000 (involving one extra HTTP request due to HTTP 302)
- third-party libraries such as https://www.npmjs.com/package/wikimedia-commons-file-path
Is there a way to obtain the thumbnail without any of the drawbacks listed above? For instance, https://commons.wikimedia.org/wiki/File:Wikimania.svg?thumbnail&width=1000 could directly provide the thumbnail.
This relates to a discussion with @MartinK and @TheDJ at Wikimania 2019.