PHP Class SlightPHP\Thumbnail

Afficher le fichier Open project: hetao29/slightphp

Protected Properties

Свойство Type Description
$formats array possible image formats
$image resource
$image_height integer
$image_path string path/filename of imagefile
$image_type integer image format of source
$image_width integer
$quality_thumb boolean quality or speed when generating the thumbnail
$thumb_max_height integer maximal height of the generated thumbnail
$thumb_max_width integer maximal width of the generated thumbnail
$thumbnail resource
$thumbnail_height integer
$thumbnail_type integer image format of the thumbnail
$thumbnail_width integer

Méthodes publiques

Méthode Description
__construct ( string $file = '' ) : void Constructor
getPictureName ( ) : integer returns the width of the thumbnail
getThumbHeight ( ) : integer returns the height of the thumbnail
getThumbWidth ( ) : integer returns the width of the thumbnail
outputThumbnail ( string $format = 'png', integer $quality = 75 ) : void outputs the thumbnail to the browser
returnThumbnail ( ) : mixed returns the variable with the thumbnail image
setMaxHeight ( integer $height ) : boolean sets the max. height of the thumbnail
setMaxSize ( integer $width, integer $height ) : boolean sets the max. width and height of the thumbnail
setMaxWidth ( integer $width ) : boolean sets the max. width of the thumbnail
setOutputFormat ( string $format = 'png' ) : void sets the output type of the thumbnail
setQualityOutput ( boolean $boolean = TRUE ) : void whether to create thumbs fast or with good quality

Méthodes protégées

Méthode Description
createThumbnail ( ) : void creates the thumbnail and saves it to a variable
readSourceImage ( ) : void reads the source image into a variable
readSourceImageData ( ) : void reads metadata of the source image
setThumbnailSize ( ) : void sets the actual width and height of the thumbnail based on the source image size and the max limits for the thumbnail

Method Details

__construct() public méthode

Constructor
public __construct ( string $file = '' ) : void
$file string path/filename of picture or stream from a DB field
Résultat void

createThumbnail() protected méthode

creates the thumbnail and saves it to a variable
protected createThumbnail ( ) : void
Résultat void

getPictureName() public méthode

returns the width of the thumbnail
public getPictureName ( ) : integer
Résultat integer

getThumbHeight() public méthode

returns the height of the thumbnail
public getThumbHeight ( ) : integer
Résultat integer

getThumbWidth() public méthode

returns the width of the thumbnail
public getThumbWidth ( ) : integer
Résultat integer

outputThumbnail() public méthode

outputs the thumbnail to the browser
public outputThumbnail ( string $format = 'png', integer $quality = 75 ) : void
$format string
$quality integer
Résultat void

readSourceImage() protected méthode

reads the source image into a variable
protected readSourceImage ( ) : void
Résultat void

readSourceImageData() protected méthode

reads metadata of the source image
protected readSourceImageData ( ) : void
Résultat void

returnThumbnail() public méthode

returns the variable with the thumbnail image
public returnThumbnail ( ) : mixed
Résultat mixed

setMaxHeight() public méthode

sets the max. height of the thumbnail
public setMaxHeight ( integer $height ) : boolean
$height integer
Résultat boolean

setMaxSize() public méthode

passes values to the functions setMaxHeight() and setMaxWidth()
public setMaxSize ( integer $width, integer $height ) : boolean
$width integer
$height integer
Résultat boolean

setMaxWidth() public méthode

sets the max. width of the thumbnail
public setMaxWidth ( integer $width ) : boolean
$width integer
Résultat boolean

setOutputFormat() public méthode

sets the output type of the thumbnail
public setOutputFormat ( string $format = 'png' ) : void
$format string gif, jpg, png, wbmp
Résultat void

setQualityOutput() public méthode

whether to create thumbs fast or with good quality
public setQualityOutput ( boolean $boolean = TRUE ) : void
$boolean boolean
Résultat void

setThumbnailSize() protected méthode

sets the actual width and height of the thumbnail based on the source image size and the max limits for the thumbnail
protected setThumbnailSize ( ) : void
Résultat void

Property Details

$formats protected_oe property

possible image formats
protected array $formats
Résultat array

$image protected_oe property

protected resource $image
Résultat resource

$image_height protected_oe property

protected int $image_height
Résultat integer

$image_path protected_oe property

path/filename of imagefile
protected string $image_path
Résultat string

$image_type protected_oe property

image format of source
protected int $image_type
Résultat integer

$image_width protected_oe property

protected int $image_width
Résultat integer

$quality_thumb protected_oe property

quality or speed when generating the thumbnail
protected bool $quality_thumb
Résultat boolean

$thumb_max_height protected_oe property

maximal height of the generated thumbnail
protected int $thumb_max_height
Résultat integer

$thumb_max_width protected_oe property

maximal width of the generated thumbnail
protected int $thumb_max_width
Résultat integer

$thumbnail protected_oe property

protected resource $thumbnail
Résultat resource

$thumbnail_height protected_oe property

protected int $thumbnail_height
Résultat integer

$thumbnail_type protected_oe property

image format of the thumbnail
protected int $thumbnail_type
Résultat integer

$thumbnail_width protected_oe property

protected int $thumbnail_width
Résultat integer