Oh right, thanks, I think I knew that at one point...
So if I have the following response from the mobile API, with a "lazy load"
image:
<span
class="mw-file-element gallery-img pcs-widen-image-override
pcs-lazy-load-placeholder pcs-lazy-load-placeholder-pending"
style="width: 1500px"
data-class="mw-file-element gallery-img pcs-widen-image-override"
data-src="//
upload.wikimedia.org/wikipedia/commons/thumb/4/44/BMW.svg/1200px-BMW.svg.png
"
data-width="1200"
data-height="1500"
data-alt="Logo used in vehicles since 1997"
data-data-file-width="2400"
data-data-file-height="3000"
data-data-file-original-src="//
upload.wikimedia.org/wikipedia/commons/thumb/4/44/BMW.svg/800px-BMW.svg.png"
><span style="padding-top: 100%">
And I want to convert it to an actual <img> tag at a smaller size, also
embedding the image binary in our app (Kiwix), I should no longer request
https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/BMW.svg/*400px*
-BMW.svg.png (and then set the width/height attributes to 400px by 320px in
the app), but instead request
https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/BMW.svg/*330**px*
-BMW.svg.png and set the height to 264px?
Thanks,
-Travis
On Fri, Jan 23, 2026 at 10:43 AM AntiCompositeNumber <[email protected]>
wrote:
> Wikimedia thumbnail URLs are based on width only. Scaling maintains the
> original ratio.
>
> AntiCompositeNumber
> (they/them)
>
> On Fri, Jan 23, 2026, at 13:41, Travis Briggs wrote:
> > Hi Amir,
> >
> > Thanks for the heads up on this. I'm confused about the idea of
> > standard "sizes", as listed. Thumbnails have two dimensions, two sizes,
> > width and height right? Do both dimensions have to be one of the
> > standard sizes? What if that causes image stretching?
> >
> > Thanks,
> > -Travis
> >
> > On Fri, Jan 23, 2026 at 10:28 AM Amir Sarabadani via Wikitech-l
> > <[email protected]> wrote:
> >> Thumbnails shown on-wiki are already quantized to a set of standard
> sizes (if a non-standard size is requested, the next-larger standard size
> is used, and scaled to the requested size by the browser). We have recently
> extended the set of standard sizes, and are now moving to only allow
> standard sizes to be used. Regular editing and viewing will not be impacted
> by this change at all.
> >>
> >> * What isn't changing?
> >>
> >> Thumbnails served on wiki (via the "thumb" argument to File:, and via
> the Media API) will continue to behave as they do now - if you request a
> non-standard size, the next-larger standard size will be provided, and
> scaled in-browser if appropriate.
> >>
> >> * What is changing?
> >>
> >> Requests for non-standard thumbnail sizes using other methods (e.g.
> constructing an upload.wikimedia.org URL with a non-standard thumbnail
> size) will be blocked by our CDN. These are already being rate-limited for
> requests that we assess are not coming from a web-browser.
> >>
> >> During this quarter, we will be broadening the scope of the existing
> rate-limiting and making it increasingly strict, with the aim being to
> refuse such requests entirely by the end of March 2026.
> >>
> >> * Why are WMF doing this?
> >>
> >> Historically, we have generated thumbnails of whatever size was
> requested; this has been a drain on our thumbnailing infrastructure and
> cost us in network bandwidth and storage volume. With the increasing
> prevalence of highly aggressive scrapers, this has become an intolerable
> burden on our network, infrastructure, and staff, who have spent a lot of
> time over the holiday period working hard to keep the wikis available for
> people to read in the face of automated abuse.
> >>
> >> * What do I need to do?
> >>
> >> Most likely, nothing: we have already tracked down some of the more
> widely-deployed sources of nonstandard thumbnail requests (e.g. Popups
> extension) and fixed them. If you own or operate something that requests
> thumbnails by constructing a thumbnail URI directly, then now is the time
> to either use the Media API instead or to make sure you only request
> standard thumbnail sizes.
> >>
> >> * What are the standard thumbnail sizes?
> >>
> >> They are: 20px, 40px, 60px, 120px, 250px, 330px, 500px, 960px, 1280px,
> 1920px, 3840px
> >>
> >> They are defined in config as $wgThumbnailSteps -
> >>
> https://gerrit.wikimedia.org/r/plugins/gitiles/operations/mediawiki-config/+/refs/heads/master/wmf-config/CommonSettings.php
> >>
> >> And also documented on MetaWiki -
> >> https://www.mediawiki.org/wiki/Common_thumbnail_sizes
> >>
> >> To help fix the existing instances, please see
> https://phabricator.wikimedia.org/T414805 for search-links, and examples
> of how to fix them.
> >>
> >> Best
> >> --
> >> *Amir Sarabadani (he/him)*
> >> Staff Database Architect
> >> Wikimedia Foundation <https://wikimediafoundation.org/>
> >>
> >> _______________________________________________
> >> Wikitech-l mailing list -- [email protected]
> >> To unsubscribe send an email to [email protected]
> >>
> https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
> > _______________________________________________
> > Wikitech-l mailing list -- [email protected]
> > To unsubscribe send an email to [email protected]
> >
> https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
> _______________________________________________
> Wikitech-l mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
_______________________________________________
Wikitech-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/