Commit 807a68c9 authored by Ivan Tyagov's avatar Ivan Tyagov

SVG format is a textual data which can be returned as it is

so client (browser) can draw an image out of it
parent 5e129d40
...@@ -264,6 +264,11 @@ class Image(TextConvertableMixin, File, OFSImage): ...@@ -264,6 +264,11 @@ class Image(TextConvertableMixin, File, OFSImage):
""" """
Implementation of conversion for Image files Implementation of conversion for Image files
""" """
if format == 'svg' and self.getContentType()=='image/svg+xml':
# SVG format is a textual data which can be returned as it is
# so client (browser) can draw an image out of it
return self.getContentType(), self.getData()
if format in VALID_TEXT_FORMAT_LIST: if format in VALID_TEXT_FORMAT_LIST:
try: try:
return self.getConversion(format=format) return self.getConversion(format=format)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment