Commit 933ca5f8 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fix a bug introduced in r28375.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28381 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b2e63011
......@@ -102,16 +102,18 @@ class PDFDocument(Image, ConversionCacheMixin):
try:
return self.getConversion(format=format)
except KeyError:
mime = 'text/html'
data = self._convertToHTML()
self.setConversion(data, mime='text/html', format=format)
return (mime, aq_base(data))
self.setConversion(data, mime=mime, format=format)
return (mime, data)
elif format in ('txt', 'text'):
try:
return self.getConversion(format='txt')
except KeyError:
mime = 'text/plain'
data = self._convertToText()
self.setConversion(data, mime='text/plain', format='txt')
return (mime, aq_base(data))
self.setConversion(data, mime=mime, format='txt')
return (mime, data)
else:
return Image.convert(self, format, **kw)
......
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