Expand all

ThumbnailInfo

Constructor

new ThumbnailInfo(api, [options]) #

Parameters:

Name Type Attributes Description
api mw.Api
options Object optional
Properties:
Name Type Attributes Description
maxage number optional

cache expiration time, in seconds Will be used for both client-side cache (maxage) and reverse proxies (s-maxage)

Source:

Methods

get(file, sampleUrl, width, height) → {jQuery.Promise.<Thumbnail>} #

Runs an API GET request to get the thumbnail info for the specified size. The thumbnail always has the same aspect ratio as the full image. One of width or height can be null; if both are set, the API will return the largest thumbnail which fits into a width x height bounding box (or the full-sized image - whichever is smaller).

Parameters:

Name Type Description
file mw.Title
sampleUrl string

a thumbnail URL for the same file (but with different size).

width number

thumbnail width in pixels

height number

thumbnail height in pixels

Source:

Returns:

Type
jQuery.Promise.<Thumbnail>
Runs an API GET request to get the thumbnail info for the specified size.