Skip to content

Commit

Permalink
Update scaling.py
Browse files Browse the repository at this point in the history
  • Loading branch information
balavec committed Oct 29, 2019
1 parent c18fb40 commit d401ee9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plone/namedfile/scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ def __init__(self, context, request, **info):

url = self.context.absolute_url()
extension = self.data.contentType.split('/')[-1].lower()
if self.data.contentType in ["image/svg", "image/svg+xml"]:
if self.data.contentType == "image/svg+xml":
extension = "svg"
self.data.contentType = "image/svg+xml"
if 'uid' in info:
name = info['uid']
else:
Expand Down Expand Up @@ -250,7 +249,7 @@ def __call__(
except IOError:
if getattr(orig_value, 'contentType', '') == 'image/svg+xml':
orig_data.seek(0)
result = orig_data.read(), 'SVG', (width, height)
result = orig_data.read(), 'svg+xml', (width, height)
else:
logger.exception(
'Could not scale "{0!r}" of {1!r}'.format(
Expand Down

0 comments on commit d401ee9

Please sign in to comment.