PHP Class SlightPHP\WMThumbnail

Tested with Apache 2.2 and PHP 5.2. Last change: 2008-04-06
Author: Michael Wimmer ([email protected])
Inheritance: extends Thumbnail
Show file Open project: hetao29/slightphp

Protected Properties

Property Type Description
$logos array holds all logos/watermarks
$wm_image resource
$wm_image_height integer
$wm_image_path string path/filename of logo / watermark
$wm_image_type integer image format of logo
$wm_image_width integer

Public Methods

Method Description
__construct ( string $file = '', integer $seconds ) : void Constructor
addLogo ( string $logo = '', integer $position = 3, integer $margin = 1 ) : void sets the position of the logo /watermark
outputThumbnail ( string $format = 'png', integer $quality = 75 ) : mixed outputs the thumbnail to the browser
returnThumbnail ( string $format = 'png' ) : mixed returns the variable with the thumbnail image

Protected Methods

Method Description
createThumbnail ( ) : void creates the thumbnail and saves it to a variable
readWMImage ( string $path = '' ) : void reads the logo pic into a variable
readWMImageData ( string $path = '' ) : void reads metadata of the logo image

Method Details

__construct() public method

Constructor
public __construct ( string $file = '', integer $seconds ) : void
$file string path/filename of picture
$seconds integer amount of seconds thumbs should be cached. 0 = no cache
return void

createThumbnail() protected method

creates the thumbnail and saves it to a variable
protected createThumbnail ( ) : void
return void

outputThumbnail() public method

overrides method of base class
public outputThumbnail ( string $format = 'png', integer $quality = 75 ) : mixed
$format string gif, jpg, png, wbmp
$quality integer jpg-quality: 0-100
return mixed

readWMImage() protected method

reads the logo pic into a variable
protected readWMImage ( string $path = '' ) : void
$path string path/filename of picture
return void

readWMImageData() protected method

reads metadata of the logo image
protected readWMImageData ( string $path = '' ) : void
$path string path/filename of picture
return void

returnThumbnail() public method

returns the variable with the thumbnail image
public returnThumbnail ( string $format = 'png' ) : mixed
$format string gif, jpg, png, wbmp
return mixed

Property Details

$logos protected property

holds all logos/watermarks
protected array $logos
return array

$wm_image protected property

protected resource $wm_image
return resource

$wm_image_height protected property

protected int $wm_image_height
return integer

$wm_image_path protected property

path/filename of logo / watermark
protected string $wm_image_path
return string

$wm_image_type protected property

image format of logo
protected int $wm_image_type
return integer

$wm_image_width protected property

protected int $wm_image_width
return integer