Back to index

plone3  3.1.7
Public Member Functions | Private Attributes | Static Private Attributes
PortalTransforms.libtransforms.piltransform.PILTransforms Class Reference
Collaboration diagram for PortalTransforms.libtransforms.piltransform.PILTransforms:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def name
def convert

Private Attributes

 __name__

Static Private Attributes

 __implements__ = itransform
string __name__ = "piltransforms"

Detailed Description

Definition at line 5 of file piltransform.py.


Constructor & Destructor Documentation

Definition at line 8 of file piltransform.py.

00008 
00009     def __init__(self, name=None):
00010          if name is not None:
00011             self.__name__ = name


Member Function Documentation

def PortalTransforms.libtransforms.piltransform.PILTransforms.convert (   self,
  orig,
  data,
  kwargs 
)

Definition at line 15 of file piltransform.py.

00015 
00016     def convert(self, orig, data, **kwargs):
00017         imgio = StringIO()
00018         orig = StringIO(orig)
00019         newwidth = kwargs.get('width',None)
00020         newheight = kwargs.get('height',None)
00021         pil_img = PIL.Image.open(orig)
00022         if(self.format in ['jpeg','ppm']):
00023             pil_img.draft("RGB", pil_img.size)
00024             pil_img = pil_img.convert("RGB")
00025         if(newwidth or newheight):
00026             pil_img.thumbnail((newwidth,newheight),PIL.Image.ANTIALIAS)
00027         pil_img.save(imgio,self.format)
00028         data.setData(imgio.getvalue())
00029         return data
00030 
00031 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 12 of file piltransform.py.

00012 
00013     def name(self):
00014         return self.__name__

Here is the caller graph for this function:


Member Data Documentation

Definition at line 6 of file piltransform.py.

string PortalTransforms.libtransforms.piltransform.PILTransforms.__name__ = "piltransforms" [static, private]

Definition at line 7 of file piltransform.py.

Definition at line 10 of file piltransform.py.


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