Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Static Private Attributes
ATContentTypes.content.image.ATImage Class Reference
Inheritance diagram for ATContentTypes.content.image.ATImage:
Inheritance graph
[legend]
Collaboration diagram for ATContentTypes.content.image.ATImage:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def exportImage
def setImage
def tag
def __str__
def get_size
def getSize
def getWidth
def getHeight
def cmf_edit
def __bobo_traverse__

Static Public Attributes

 schema = ATImageSchema
string portal_type = 'Image'
string archetype_name = 'Image'
tuple assocMimetypes = ('image/*', )
tuple assocFileExt = ('jpg', 'jpeg', 'png', 'gif', )
tuple cmf_edit_kws = ('file', )
tuple security = ClassSecurityInfo()
tuple width = ComputedAttribute(getWidth, 1)
tuple height = ComputedAttribute(getHeight, 1)

Static Private Attributes

dictionary _atct_newTypeFor = {'portal_type' : 'CMF Image', 'meta_type' : 'Portal Image'}
 __implements__ = ATCTFileContent.__implements__,IATImage

Detailed Description

An image, which can be referenced in documents or displayed in an album.

Definition at line 94 of file image.py.


Member Function Documentation

def ATContentTypes.content.image.ATImage.__bobo_traverse__ (   self,
  REQUEST,
  name 
)
Transparent access to image scales

Definition at line 170 of file image.py.

00170 
00171     def __bobo_traverse__(self, REQUEST, name):
00172         """Transparent access to image scales
00173         """
00174         if name.startswith('image'):
00175             field = self.getField('image')
00176             image = None
00177             if name == 'image':
00178                 image = field.getScale(self)
00179             else:
00180                 scalename = name[len('image_'):]
00181                 if scalename in field.getAvailableSizes(self):
00182                     image = field.getScale(self, scale=scalename)
00183             if image is not None and not isinstance(image, basestring):
00184                 # image might be None or '' for empty images
00185                 return image
00186 
00187         return ATCTFileContent.__bobo_traverse__(self, REQUEST, name)
00188 
00189 registerATCT(ATImage, PROJECTNAME)

Here is the call graph for this function:

cmf compatibility

Definition at line 129 of file image.py.

00129 
00130     def __str__(self):
00131         """cmf compatibility
00132         """
00133         return self.tag()

Here is the call graph for this function:

def ATContentTypes.content.image.ATImage.cmf_edit (   self,
  precondition = '',
  file = None,
  title = None 
)

Definition at line 163 of file image.py.

00163 
00164     def cmf_edit(self, precondition='', file=None, title=None):
00165         if file is not None:
00166             self.setImage(file)
00167         if title is not None:
00168             self.setTitle(title)
00169         self.reindexObject()

Here is the call graph for this function:

def ATContentTypes.content.image.ATImage.exportImage (   self,
  format,
  width,
  height 
)

Definition at line 110 of file image.py.

00110 
00111     def exportImage(self, format, width, height):
00112         return '',''

ZMI / Plone get size method

BBB: ImageField.get_size() returns the size of the original image + all
scales but we want only the size of the original image.

Definition at line 135 of file image.py.

00135 
00136     def get_size(self):
00137         """ZMI / Plone get size method
00138 
00139         BBB: ImageField.get_size() returns the size of the original image + all
00140         scales but we want only the size of the original image.
00141         """
00142         img = self.getImage()
00143         if not getattr(aq_base(img), 'get_size', False):
00144             return 0
00145         return img.get_size()

Here is the call graph for this function:

Here is the caller graph for this function:

def ATContentTypes.content.image.ATImage.getHeight (   self,
  scale = None 
)

Definition at line 156 of file image.py.

00156 
00157     def getHeight(self, scale=None):
00158         return self.getSize(scale)[1]

Here is the call graph for this function:

def ATContentTypes.content.image.ATImage.getSize (   self,
  scale = None 
)

Definition at line 147 of file image.py.

00147 
00148     def getSize(self, scale=None):
00149         field = self.getField('image')
00150         return field.getSize(self, scale=scale)

Here is the call graph for this function:

Here is the caller graph for this function:

def ATContentTypes.content.image.ATImage.getWidth (   self,
  scale = None 
)

Definition at line 152 of file image.py.

00152 
00153     def getWidth(self, scale=None):
00154         return self.getSize(scale)[0]

Here is the call graph for this function:

def ATContentTypes.content.image.ATImage.setImage (   self,
  value,
  refresh_exif = True,
  kwargs 
)
Set id to uploaded id

Definition at line 114 of file image.py.

00114 
00115     def setImage(self, value, refresh_exif=True, **kwargs):
00116         """Set id to uploaded id
00117         """
00118         # set exif first because rotation might screw up the exif data
00119         # the exif methods can handle str, Pdata, OFSImage and file
00120         # like objects
00121         self.getEXIF(value, refresh=refresh_exif)
00122         self._setATCTFileContent(value, **kwargs)

Here is the call graph for this function:

Here is the caller graph for this function:

def ATContentTypes.content.image.ATImage.tag (   self,
  kwargs 
)
Generate image tag using the api of the ImageField

Definition at line 124 of file image.py.

00124 
00125     def tag(self, **kwargs):
00126         """Generate image tag using the api of the ImageField
00127         """
00128         return self.getField('image').tag(self, **kwargs)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

ATContentTypes.content.image.ATImage.__implements__ = ATCTFileContent.__implements__,IATImage [static, private]

Definition at line 106 of file image.py.

dictionary ATContentTypes.content.image.ATImage._atct_newTypeFor = {'portal_type' : 'CMF Image', 'meta_type' : 'Portal Image'} [static, private]

Definition at line 101 of file image.py.

Definition at line 100 of file image.py.

tuple ATContentTypes.content.image.ATImage.assocFileExt = ('jpg', 'jpeg', 'png', 'gif', ) [static]

Definition at line 103 of file image.py.

Definition at line 102 of file image.py.

Definition at line 104 of file image.py.

tuple ATContentTypes.content.image.ATImage.height = ComputedAttribute(getHeight, 1) [static]

Definition at line 160 of file image.py.

Definition at line 99 of file image.py.

Definition at line 97 of file image.py.

tuple ATContentTypes.content.image.ATImage.security = ClassSecurityInfo() [static]

Definition at line 108 of file image.py.

tuple ATContentTypes.content.image.ATImage.width = ComputedAttribute(getWidth, 1) [static]

Definition at line 159 of file image.py.


The documentation for this class was generated from the following file: