Commit df23b501 authored by Nicolas Delaby's avatar Nicolas Delaby

Honour format passed in parameters (src="image-reference?format=png")


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45088 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4c126278
...@@ -124,6 +124,7 @@ class OOOdCommandTransform(commandtransform): ...@@ -124,6 +124,7 @@ class OOOdCommandTransform(commandtransform):
'mimetypes_registry').lookup(content_type) 'mimetypes_registry').lookup(content_type)
format = image_parameter_dict.pop('format', None) format = image_parameter_dict.pop('format', None)
if not format:
for mimetype_object in mimetype_list: for mimetype_object in mimetype_list:
if mimetype_object.extensions: if mimetype_object.extensions:
format = mimetype_object.extensions[0] format = mimetype_object.extensions[0]
...@@ -134,7 +135,7 @@ class OOOdCommandTransform(commandtransform): ...@@ -134,7 +135,7 @@ class OOOdCommandTransform(commandtransform):
if getattr(image, 'meta_type', None) == 'ERP5 Image': if getattr(image, 'meta_type', None) == 'ERP5 Image':
#ERP5 API #ERP5 API
# resize image according parameters # resize image according parameters
mime, image_data = image.convert(None, **image_parameter_dict) mime, image_data = image.convert(format, **image_parameter_dict)
image = OFSImage(image.getId(), image.getTitle(), image_data) image = OFSImage(image.getId(), image.getTitle(), image_data)
# image should be OFSImage # image should be OFSImage
......
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