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 = '' | |
Sample usage.
$thumbnail = new Pluf_Image_Thumbnail($thumbnail_folder, $source_image); if (!$thumbnail->exists()) { $thumbnail_filename = $thumbnail->generate(); }
| Pluf_Image_Thumbnail::__construct | ( | $ | dir, | |
| $ | source = '' | |||
| ) |
Max width and heigth of the thumb. Init the thumbnail class.
| 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.
| array | Optional size. |
| 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.
| 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] |
Resample the image http://www.php.net/manual/en/function.imagecopyresized.php
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) |