Try our conversational search powered by Generative AI!

Could not add an SVG image with ImageGalleryHandler


I am using ImageGalleryHandler to save the Image in the system. It works fine for image files (.jpg, .png etc.) However, it does not let me to add an SVG image to the system.

I have used the AddImage(Image) to add the image.

EPiServer.Community.ImageGallery.Image newImage = new EPiServer.Community.ImageGallery.Image(imageGallery, imageName, description, author,

                    Status = status,
                    LanguageID = languageID

newImage = ImageGalleryHandler.Instance.AddImage(newImage); //Throws FrameworkException for SVG images

When debugged I am getting this from FrameworkException (Screenshot) -!Ao3_PEzak8vNlU3KZiOeBNum9a81

It says "Image file could not be read, this could be because the file is corrupt or in an unsupported format"

I am sure that my file is not corrupted. And is this true? Are the SVG files not supported?

Edited, Sep 19, 2018 6:30

You have to add support by your self. You can find code in this blog: :)

Sep 20, 2018 11:57
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.