Commit 6cfc2d00 authored by Nicolas Delaby's avatar Nicolas Delaby

Unify usage if format == None.

If format is None it means that we do not want to change the format
and return the raw data or a resized image in same format.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35752 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 653efceb
......@@ -275,7 +275,7 @@ class Image(TextConvertableMixin, File, OFSImage):
return links
security.declareProtected('Access contents information', 'displayMap')
def displayMap(self, exclude=None, format='', quality=DEFAULT_QUALITY,
def displayMap(self, exclude=None, format=None, quality=DEFAULT_QUALITY,\
resolution=None):
"""Return list of displays with size info."""
displays = []
......
......@@ -142,9 +142,6 @@ class TextDocument(CachedConvertableMixin, BaseConvertableFileMixin,
if not format:
# can return document without conversion
return src_mimetype, self.getTextContent()
# Return the raw content
if format == 'raw':
return 'text/plain', self.getTextContent()
portal = self.getPortalObject()
mime_type = getToolByName(portal, 'mimetypes_registry').\
lookupExtension('name.%s' % format)
......
......@@ -191,7 +191,9 @@ class IDocument(Interface):
format - the format specied in the form of an extension
string (ex. jpeg, html, text, txt, etc.)
**kw can be various things - e.g. resolution
if format is None means that we do not want to change the format
and return the raw data or a resized image in same format.
**kw - can be various things - e.g. resolution
"""
def isSupportBaseDataConversion():
......
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