Commit f172b5dc authored by Jérome Perrin's avatar Jérome Perrin

export a method so that skins can access image size for a given image_display.

This is used in odt_style to display ImageFields


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19847 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 30149e93
......@@ -61,6 +61,13 @@ defaultdisplays = {'nano' : (25,25),
'xlarge' : (1024,1024)
}
def getSizeFromImageDisplay(image_display):
"""Retuns the size for this image display, or None if this image display name
is not known.
"""
return defaultdisplays.get(image_display)
default_formats = ['jpg', 'jpeg', 'png', 'gif', 'pnm', 'ppm']
class Image(File, OFSImage):
......
......@@ -91,6 +91,8 @@ def initialize( context ):
'Redirect', 'Unauthorized')
ModuleSecurityInfo('Products.CMFCore.WorkflowCore').declarePublic(
'WorkflowException')
ModuleSecurityInfo('Products.ERP5.Document.Image').declarePublic(
'getSizeFromImageDisplay')
# backward compatibility names
XML = None
......
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