\Pluf_Image_Thumbnail

Generate the thumbnail of an image.

Sample usage.

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

Summary

Methods
Properties
Constants
__construct()
getName()
getPath()
exists()
getSize()
generate()
gd_version()
$source
$size
No constants found
resampleBicubic()
$dir
$filename
N/A
No private methods found
No private properties found
N/A

Properties

$source

$source : 

Type

$size

$size : 

Type

$dir

$dir : 

Type

$filename

$filename : 

Type

Methods

__construct()

__construct(  $dir,   $source = '') 

Init the thumbnail class.

Parameters

$dir
$source

getName()

getName(  $size = null) : string

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

$size

Returns

string —

Filename of the thumbnail.

getPath()

getPath() 

Get the full path to the thumbnail.

exists()

exists() 

Check if the thumbnail exists.

getSize()

getSize() 

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

generate()

generate() : mixed

Create thumbnail of an image, proportions are kept.

Returns

mixed —

Filename or false.

gd_version()

gd_version() 

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

resampleBicubic()

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

Resample the image http://www.php.net/manual/en/function.imagecopyresized.php

Parameters

$dst
$src
$dstx
$dsty
$srcx
$srcy
$w
$h
$zoomX
$zoomY