images.rst 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Best Practices for Images
  2. =========================
  3. For Editors
  4. -----------
  5. **Logo** and **Favicon**: Upload your logo and favicon under **Settings >
  6. Layout** using high resolution PNG (or WebP) files. Any size or resolution is
  7. acceptable. Note that the Favicon will be cropped to a square (1:1) aspect
  8. ratio.
  9. **Cover Images**: Cover images added to Web Pages, Article Pages, Event Pages,
  10. etc. will all be scaled to a **16:9 aspect ratio** with a maximum resolution of
  11. **1600x900 pixels**. Generally these should be uploaded in JPG (or WebP) format.
  12. Any resolution is fine, but common resolutions such as 1280x720, 1600x900, etc.
  13. are most appropriate. Avoid uploading huge "raw" image files (e.g. images
  14. greater than 1 MB in file size).
  15. **Image Blocks**: Images added in the page body (via the Image or Image Link
  16. blocks) will keep their original aspect ratio preserved, but will be scaled to a
  17. maximum width or height of 1600 pixels. Any aspect ratio or image resolution is
  18. acceptable.
  19. For Developers
  20. --------------
  21. .. versionadded:: 1.0
  22. Images are served in WebP format.
  23. As of version 1.0, all images are served in WebP format. WebP format provides
  24. the benefit of significantly smaller file sizes and results in an overall faster
  25. website with better SEO performance. All mainstream browsers released after 2020
  26. include WebP support. The following browsers and/or operating systems *do not*
  27. support WebP, but might still be in use:
  28. * Internet Explorer
  29. * Safari on macOS 10 or older
  30. * iOS 13 or older
  31. * Consult the `full list of WebP browser support <https://caniuse.com/webp>`_
  32. If your website needs to support these systems, we recommend having Wagtail
  33. substitute WebP for JPG with the following setting in your Django settings file:
  34. .. code-block:: python
  35. WAGTAILIMAGES_FORMAT_CONVERSIONS = {
  36. "webp": "jpeg",
  37. }
  38. If you would like to support both WebP and alternative fallback image formats,
  39. you may need to override the default CRX templates to use the `picture element
  40. as described in the Wagtail docs
  41. <https://docs.wagtail.org/en/stable/advanced_topics/images/image_file_formats.html>`_.