Logo Search packages:      
Sourcecode: zope-cmfphoto version File versions  Download package

def CMFPhoto::Photo::Photo::checkForVariant (   self,
  size 
)

Create variant if not there.

Definition at line 216 of file Photo.py.

00216                                    :
      """Create variant if not there."""
        if size in self.photo_display_sizes().keys():
          # Create resized copy, if it doesnt already exist
            if not self._photos.has_key(size):
                self._photos[size] = OFS.Image.Image(size, size,
                                                     self._resize(self.photo_display_sizes().get(size, (0,0))))
            # a copy with a content type other than image/* exists, this
            # probably means that the last resize process failed. retry
            elif not self._photos[size].getContentType().startswith('image'):
                self._photos[size] = OFS.Image.Image(size, size,
                                                     self._resize(self.photo_display_sizes().get(size, (0,0))))

            return 1

        else: return 0

    security.declareProtected(CMFCorePermissions.View, 'index_html')
    def index_html(self, REQUEST, RESPONSE, size=None):


Generated by  Doxygen 1.6.0   Back to index