**Background:**
The "thumbwidth" parameter was added to mobileview to let us request the url for a size variant of an image bound by a certain width. i.e. say we want a 640px wide version of an image regardless of its height, such as for "lead" images. (Previously only "thumbsize" was available and it restricted *both* height and width.)
Anyway, the expected behavior is that thumbwidth set to, say 640, would get us the url to the size variant of the image closest to, but not exceeding, 640 in width, regardless of its height.
However, it appears that, for some images, a lower resolution variant url is returned:
**Example:**
https://en.wikipedia.org/w/api.php?action=mobileview&format=jsonfm&page=wikipedia&thumbwidth=640&prop=thumb
Returns:
"thumb": {
"url": "//upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/103px-Wikipedia-logo-v2.svg.png",
"width": 103,
"height": 94
}
What I would expect it to return is the following url:
"thumb": {
"url": "//upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/640px-Wikipedia-logo-v2.svg.png",
"width": 640,
"height": 584
}