Commit 5520312a authored by Nicolas Delaby's avatar Nicolas Delaby

revert r35292

The cached value need to be the image itself, not only image content.
The work around md5 hashing calculation is still on going



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35381 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 69092ae7
......@@ -128,11 +128,6 @@ class CachedConvertableMixin:
"""
"""
cache_id = self._getCacheKey(**kw)
if isinstance(data, OFSImage):
# data.data should be a Pdata object
data = data.data
if data is None:
cached_value = None
conversion_md5 = None
......@@ -141,11 +136,14 @@ class CachedConvertableMixin:
cached_value = aq_base(data)
conversion_md5 = hashPdataObject(cached_value)
size = len(cached_value)
elif isinstance(data, OFSImage):
cached_value = data
conversion_md5 = md5.new(str(data.data)).hexdigest()
size = len(data.data)
else:
cached_value = data
conversion_md5 = md5.new(cached_value).hexdigest()
size = len(cached_value)
if date is None:
date = DateTime()
stored_data_dict = {'content_md5': self.getContentMd5(),
......
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