API Documentation

Functions

scale , thumb , getHeight , getOrientation , crop , alter , getWidth , rotate , aspect_ratio , get_EXIF_info

Extended Image API


scale(self, factor=1.0, REQUEST=None, RESPONSE=None, **kw):

Generate image or tag for image scaled to factor


thumb(self, height=None, width=None, REQUEST=None, RESPONSE=None, **kw):

Generate image or tag for a thumbnail image maintaining aspect ratio default size is 80 x 80


getHeight(self):

Return the height in pixels


getOrientation(self):

Returns the orientation of the image

  1. No Rotation
  2. Rotated 180 degrees
  3. Rotated 270 degrees
  4. Rotated 90 degrees

crop(self, box, REQUEST=None, RESPONSE=None, **kw):

Generate image or tag for the box cropped from image


alter(self, box=None, degrees=None, width=None, height=None, REQUEST=None, RESPONSE=None, **kw):

If accessed through a URL (REQUEST is not None) altered image data is returned. If called programmatically an image tag is generated.

box is a string containing comma separated integers 1,2,3,4 x1,y1,x2,y2 crops portion of image

degrees is an integer number of degrees to rotate the image

height and width are integers which adjust the resulting image or tag

Keyword arguments are added to the image tag if REQUEST is None.


getWidth(self):

Return the width in pixels


rotate(self, degrees, REQUEST=None, RESPONSE=None, **kw):

Generate image or tag for image rotated by degrees


aspect_ratio(self):

return the image aspect ratio width/height


get_EXIF_info(self):

Return image data typically set by digital cameras.