Why would you need to get an existing thumbnail? You can always request a
thumbnail and receive one.

Let's take
https://commons.wikimedia.org/wiki/File:Virmalised_18.03.15_(4).jpg as an
example. You can try hard to figure out what thumbnails already exist for
that picture, but why bother? If you want a 197px thumbnail, just embed
https://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/Virmalised_18.03.15_%284%29.jpg
/*197px**-*Virmalised_18.03.15_%284%29.jpg in your code. The part I
highlighted in yellow specifies the size, and the red part is what you add
to the URL to make a thumbnail.

If a thumbnail exists already, it'll be sent to you; if not, one will be
created. In any case, you get a thumbnail of the desired size, and will
save on network traffic.

On Tue, Jan 9, 2018 at 4:36 PM, George, Garrett J. (JSC-CB111)[SGT, INC] <
[email protected]> wrote:

> Hey all,
>
> I've been working on image uploading in my Javascript based extension.
> Although embedding local images after uploading them works fine, there's
> the use case of wanting to embed images already uploaded to the wiki. I
> could use the AllImages API and the the url's of all the images but that
> would be a tremendous amount of network usage compared to a world in which
> I can simply get the thumbnails. I know the urls exist for the images
> because you can "copy link address" on the thumbnail when you're viewing
> the file description page.
>
> So, is there a way, using one of the many MW API's, to get the thumbnail
> url's for all the images?
>
> Thanks,
>
> Garrett
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to