Commit ccdcbe59 authored by Ivan Tyagov's avatar Ivan Tyagov

Only set display if it was previously defined into the function call (i.e. request) otherwise

this leads to a difference between generated cache id for set and get for *same* function call
thus eliminating image caching.
Examples of generated cache ids:
(get) -> 39600:5:formatpngquality45.0
(set) -> 39600:5:displayNoneformatpngquality45.0
parent 4f6cef05
......@@ -299,7 +299,9 @@ class Image(TextConvertableMixin, File, OFSImage):
image_data = image.data
# as image will always be requested through a display not by passing exact
# pixels we need to restore this way in cache
kw['display'] = display
if display is not None:
# only set if we have a real value
kw['display'] = display
image_size = kw.pop('image_size', None)
self.setConversion(image_data, mime, **kw)
return mime, image_data
......
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