Do I need to change all the SVG files to PNG before triggering a new deploy of the site?

Hey Juliana,

The SVG's should be replaced by other image formats in articles that you republish, this would be the easiest way. In articles that aren't updated the images shouldn't break.

There's also the workaround we showed in the blog article that you can implement to remove any query string params that you add in your project from SVG's:

function modifyImageUrl(imageUrl) {
  function includesMatch(lookupValue, urlString) {
    const re = new RegExp(lookupValue, 'i');
    return urlString.match(re) !== null;
  }
  if (includesMatch("images.prismic", imageUrl)) {
	return `${imageUrl}&h=60&dpr=2`;
  }
  return imageUrl;
}
const imageUrl = modifyImageUrl(document.data.imageField.url)

Other wise SVG's will still work as long as you don't add URL string parameters, they'll just be served from our Amazon servers and not through Imgix.

Let me know if you have any further questions about this.

Thanks.

1 Like