Pluf_Image_Thumbnail Class Reference

List of all members.

Public Member Functions

 __construct ($dir, $source='')
 getName ($size=null)
 getPath ()
 exists ()
 getSize ()
 generate ()

Static Public Member Functions

static gd_version ()

Public Attributes

 $source = ''
 $size = array(120, 120)

Protected Member Functions

 resampleBicubic (&$dst, &$src, $dstx, $dsty, $srcx, $srcy, $w, $h, $zoomX, $zoomY='')

Protected Attributes

 $dir = ''
 $filename = ''


Detailed Description

Generate the thumbnail of an image.

Sample usage.

$thumbnail = new Pluf_Image_Thumbnail($thumbnail_folder, $source_image); if (!$thumbnail->exists()) { $thumbnail_filename = $thumbnail->generate(); }


Constructor & Destructor Documentation

Pluf_Image_Thumbnail::__construct ( dir,
source = '' 
)

Max width and heigth of the thumb. Init the thumbnail class.


Member Function Documentation

Pluf_Image_Thumbnail::getName ( size = null  ) 

Get the name of a thumbnail from the image name, the image name can include a path this is just a md5() operation. If the height and the width are given, the info is used to generate the name, else not.

Parameters:
array Optional size.
Returns:
string Filename of the thumbnail.

Pluf_Image_Thumbnail::getPath (  ) 

Get the full path to the thumbnail.

Pluf_Image_Thumbnail::exists (  ) 

Check if the thumbnail exists.

Pluf_Image_Thumbnail::getSize (  ) 

Get the size of the last created thumbnail return the same results as the builtin getimagesize PHP function.

Pluf_Image_Thumbnail::generate (  ) 

Create thumbnail of an image, proportions are kept.

Returns:
mixed Filename or false.

static Pluf_Image_Thumbnail::gd_version (  )  [static]

Get the current GD version. Need the output buffering functions.

Pluf_Image_Thumbnail::resampleBicubic ( &$  dst,
&$  src,
dstx,
dsty,
srcx,
srcy,
w,
h,
zoomX,
zoomY = '' 
) [protected]


Member Data Documentation

Pluf_Image_Thumbnail::$dir = '' [protected]

Path to the thumbnail folder.

Pluf_Image_Thumbnail::$filename = '' [protected]

Filename of the last created thumbnail.

Pluf_Image_Thumbnail::$source = ''

Full path to the source file.

Pluf_Image_Thumbnail::$size = array(120, 120)


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

Generated on Wed Feb 3 15:44:52 2010 for Pluf by  doxygen