0

The Scenario I am currently working on is, Marketing team upload image in Media Library in Sitecore in any format. So I have to make sure if they upload in svg format, I have to take a copy of the image convert into .jpg or .png image and send it in email. For Email I am using XSL so I need a image URL something like this

http://example.com/~/media/web/Logos/example.svg converted into http://example.com/~/media/web/Logos/example.png

How could this be achieved? Is there any way I can convert the image format in Sitecore or is there any way I can get the media cache item?

Impulse
  • 31
  • 6

1 Answers1

0

There is no build-in image converter in Sitecore that allows you to convert SVG to PNG. So, you can refer to any technical realization in .NET.

About Sitecore implementation: If you need to convert image from SVG to PNG "on fly": you can override Sitecore Media Request handler with custom code. You can put technical realization that you will select in your media request handler. It should be inherited from Sitecore.Resources.Media.MediaRequestHandler. And you should put your class to web config:

<add verb="*" path="sitecore_media.ashx" type="
Community
  • 1
  • 1
Anton
  • 9,682
  • 11
  • 38
  • 68