Tailles des vignettes de Common
MediaWiki stocke les vignettes indéfiniment, de sorte que l'utilisation de nombreuses tailles de vignettes différentes peut entraîner beaucoup de stockage occupé par les vignettes. Cette page est une tentative de coordonner l'utilisation des tailles communes (et comme première étape, documenter les modèles d'utilisation existants). Sauf indication contraire, les tailles signifient la largeur en pixels.
Notez qu'il s'agit de tailles de miniatures demandées par le backend, pas de tailles visuelles.
External image requests that go through PHP (such as InstantCommons or the imageinfo API) will be rounded up to the closest standard size; direct requests (hotlinking) will be rejected unless they use a standard size. (T414805)
Paramètres de configuration recommandés
| Nom | Description | Valeur par défaut | Wikimédia |
|---|---|---|---|
$wgThumbnailSteps
|
Largeurs d'image utilisées comme pas pour les tailles de vignettes. Les tailles spécifiées manuellement ne sont pas utilisées ; au lieu de cela, la vignette avec le plus petit pas qui a une valeur plus grande que celle demandée sera affichée, mais elle sera réduite via des valeurs HTML. Il augmente la bande passante pour les utilisateurs en fournissant des tailles de vignettes légèrement plus grande que celles demandées, mais il économisera des ressources en dédupliquant la génération et le stockage des vignettes. | aucun | 20, 40, 60, 120, 250, 330, 500, 960, 1280, 1920, 3840 [1] |
$wgUploadThumbnailRenderMap
|
Tailles pré-rendues lors du téléchargement. | aucun | same |
$wgThumbLimits
|
In-article thumbnail sizes available as user preference. | 120, 150, 180, 200, 220, 250, 300, 400 | 180, 250, 400 [2] |
$wgDefaultUserOptions['thumbsize']
|
Thumbnail size used in articles when the size is not specified in the wikitext and the user has not set their preference. | 5 (250px) | same |
$wgDefaultUserOptions['imagesize']
|
Image size used on file description pages when the user has not set their preference. | 2 (800x600) | same |
$wgResponsiveImages
|
Whether to provide alternative image sizes for high-DPI displays. When enabled, article thumbnails, galleries, and images on file pages will have an srcset with 2x of the original size. | true | same |
$wgThumbUpright
|
Scaling factor applied to the $wgThumbLimits value for thumbnails where the upright wikitext option is used.
|
0.75 (187.5px) | same |
$wgGalleryOptions
|
Image sizes in galleries (when not overriden in the <gallery> tag). For traditional galleries, the imageWidth and imageHeight options are used as a bounding box to determine physical thumbnail size; for mode="packed" galleries, width is ignored and imageHeight * 1.5 is used.
|
120x120 | same |
$wgImageLimits
|
File description page image sizes available as user preference; also used for the list of download links under the image. Values are bounding boxes. | 320x240, 640x480, 800x600, 1024x768, 1280x1024, 2560x2048 | same |
$wgThumbnailBuckets
|
Intermediary thumbnail sizes to use to speed up thumbnail rendering (automatically generated when the image is first thumbnailed). | none | 1280 [3] (not sure Thumbor uses it though) |
Applications
- Thumbnails in articles: per above, 250px + 500px by default. For
uprightimages, 188px + 281px + 375px by default. Common manually specified Wikipedia image sizes: 20px or 40px for icons, 23x15px for flags. - Galleries: On Wikimedia sites, 120px for traditional galleries. Can be anything for packed galleries as they are height-constrained.
- Images on file description pages: 800px + 1200px + 1600px (or it could be anything if the image has smaller than 4:3 aspect ratio).
- Images in the file history of description pages: 120x120px (whichever side is bigger)
- Images in Galleries of Special:NewFiles, Special:Search etc, 120x120px (whichever side is bigger)
- Image download links: 320px, 640px, 800px, 1024px, 1280px, 2560px (for most images, depending on aspect ratio, as above)
- Codex thumbnail component: 40px
- MediaViewer:
$wgMediaViewerThumbnailBucketSizesset of width buckets: 320, 800, 1024, 1280, 1920, 2560, 2880 - Page previews: 320px or 640px (depending on the resolution)
- Search dropdowns:
- Vector 2022: 60px (depending on the resolution): T322621
- Wikimedia portals (e.g. wikipedia.org): 160px (T322622)
- VisualEditor:
- Link preview (
ve.init.mw.LinkCache): 80px
- Link preview (
- Wikibase: standard MediaWiki thumbnail sizes (?)
- GrowthExperiments:
- Impact module article icons: 40px, to match Codex thumbnail component size
- Task cards: 260px on mobile, 332px on desktop (?)
- Link recommendation dialog: uses
ve.init.mw.LinkCache - Image recommendation thumbnail: uses MediaWiki thumb size on desktop, screen width capped to 500px on mobile
- Image recommendation dialog: 120px or 160px depending on screen size
- Image recommendation dialog, fullscreen image preview: screen size
- Image recommendation save dialog: 226px on desktop, screen size on mobile
- Toolhub: 40/60/80px, 50/75/100px, 100/150/200px (depending on viewport resolution)
- To do: MobileFrontend search, mobile thumbnails (MobilePage::SMALL_IMAGE_WIDTH/TINY_IMAGE_WIDTH?), mobile image viewer, Special:Search snippets, Special:MediaSearch, probably a bunch of VisualEditor things, MediaViewer download/embed links, mobile apps; FullSearchResultWidget::THUMBNAIL_SIZE, SearchResultThumbnailProvider::THUMBNAIL_SIZE; see if any of these support srcset
FAQ
Q: Help, my application got a "429 Use thumbnail steps listed on https://w.wiki/GHai" message!
Make sure you're using one of the "standard" sizes referenced in $wgThumbnailSteps above. Alternatively use the imageinfo api instead of directly constructing the image's url.
Voir aussi
- Requests for comment/Standardized thumbnails sizes and the "See also" section there
- T211661#8377883 for Wikimedia Varnish stats
- T360589 for the changes in 2025-2026 to ensure compliance with standard thumbnail image sizes