Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,113 of 9,113 pages
About the help in other languages
All help pages

SVG and image formats

Which image formats editors may upload, which formats pages show, how SVG is sanitized and served safely, and when to use SVG, WebP, AVIF, PNG or JPEG on a site.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/creators/website-creators/svg-and-image-formats.md

On this page

SVG and image formats

This page is for website creators who choose image formats for a site. It explains what Exponential accepts, what it converts, and how SVG images are made safe.

Contents

  1. What editors may upload
  2. What pages show
  3. SVG
  4. Which format for what
  5. Changing the settings

What editors may upload

settings/image.ini [ImageUploadSettings]:

SettingShipped
ValidateMIMETypeenabled: the file must be one of the allowed types by content
AllowedMIMETypes[]image/jpeg, image/png, image/gif, image/webp, image/avif, image/tiff, image/bmp, image/svg+xml
SanitizeSVGenabled

What pages show

Variations (aliases) are converted according to [MIMETypeSettings] ConversionRules[]: WebP and GIF to PNG, everything else to JPEG, and [OutputSettings] AllowedOutputFormat[] (JPEG, PNG, WebP, GIF) lists what pages may show. The original alias is the uploaded file. Animated GIFs are left unscaled ([AnimatedGIF]). See Images and image variations.

SVG

Since 15 October 2026 the image datatype accepts SVG (.svg, and .svgz) on every site (SVG images):

  • An SVG can carry script, so it is never stored as uploaded: the kernel's sanitizer, expSvgSanitizer, keeps only elements and attributes known to be safe (no script, no event attributes, no foreignObject, no external references), and the stored file is its output.
  • Every upload path sanitizes: the edit form, uploads, multi-upload, the rich text editor, WebDAV, package imports.
  • Every alias of an SVG is the sanitized file itself; SVGs are never scaled.
  • The file is served with headers that stop it from running anything when opened directly; serve it with the headers the SVG page lists when you use your own web server rules.

Use SVG for logos, icons and diagrams; not for photos.

Which format for what

ImageFormat
Logo, icons, simple illustrationsSVG
PhotosJPEG, or WebP/AVIF uploads (variations become JPEG unless you change the rules)
Screenshots, images with text or transparencyPNG
Animationsshort video rather than GIF where possible

Changing the settings

Refuse SVG altogether:

# settings/override/image.ini.append.php
[ImageUploadSettings]
SanitizeSVG=disabled

(disabled refuses SVG whatever AllowedMIMETypes[] says, so an unsanitized SVG is never stored.)

Keep WebP variations as WebP instead of PNG by changing ConversionRules[]; test the result in the browsers your visitors use, then clear the generated variations (php bin/php/cache.php imagealias clear --allow-root-user).

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x