PHP Class Tollwerk\Squeezr\Image

Since: 1.0b
Author: Joschi Kuphal ([email protected])
Inheritance: extends Tollwerk\Squeezr
Afficher le fichier Open project: jkphl/squeezr Class Usage Examples

Protected Properties

Свойство Type Description
$_absoluteCacheImageDir string Parent directory of cached image file (absolute path)
$_absoluteCacheImagePath string Cached image file (absolute path)
$_absoluteImagePath string Requested image file (absolute path)
$_quantizers array Valid quantizers
$_relativeImagePath string Requested image file (relative path to document root)

Méthodes publiques

Méthode Description
instance ( string $image ) : Image Instanciate an image adaptor
send ( ) : void Send the cached and possibly downsampled image
squeeze ( string $source, string $target, string $breakpoint = SQUEEZR_BREAKPOINT, array &$errors = [] ) : string Squeeze a particular source file

Méthodes protégées

Méthode Description
__construct ( string $image ) Constructor
_downscaleGif ( string $source, integer $width, integer $height, string $target, integer $targetWidth, integer $targetHeight ) : boolean Downscale a GIF image
_downscaleJpeg ( string $source, integer $width, integer $height, string $target, integer $targetWidth, integer $targetHeight ) : boolean Downscale a JPEG image
_downscalePng ( string $source, integer $width, integer $height, string $target, integer $targetWidth, integer $targetHeight ) : boolean Downscale a PNG image
_enableTranparency ( resource $image, array $transparentColor = null ) : void Enable transparency on an image resource
_sharpenImage ( resource $image, integer $width, integer $targetWidth ) : void Sharpen an image

Method Details

__construct() protected méthode

Constructor
protected __construct ( string $image )
$image string Image file

_downscaleGif() protected static méthode

Downscale a GIF image
protected static _downscaleGif ( string $source, integer $width, integer $height, string $target, integer $targetWidth, integer $targetHeight ) : boolean
$source string Source image path
$width integer Source image width
$height integer Source image height
$target string Target image path
$targetWidth integer Target image width
$targetHeight integer Target image height
Résultat boolean Downscaled image has been saved

_downscaleJpeg() protected static méthode

Downscale a JPEG image
protected static _downscaleJpeg ( string $source, integer $width, integer $height, string $target, integer $targetWidth, integer $targetHeight ) : boolean
$source string Source image path
$width integer Source image width
$height integer Source image height
$target string Target image path
$targetWidth integer Target image width
$targetHeight integer Target image height
Résultat boolean Downscaled image has been saved

_downscalePng() protected static méthode

Downscale a PNG image
protected static _downscalePng ( string $source, integer $width, integer $height, string $target, integer $targetWidth, integer $targetHeight ) : boolean
$source string Source image path
$width integer Source image width
$height integer Source image height
$target string Target image path
$targetWidth integer Target image width
$targetHeight integer Target image height
Résultat boolean Downscaled image has been saved

_enableTranparency() protected static méthode

Enable transparency on an image resource
protected static _enableTranparency ( resource $image, array $transparentColor = null ) : void
$image resource Image resource
$transparentColor array Transparent color
Résultat void

_sharpenImage() protected static méthode

Sharpen an image
protected static _sharpenImage ( resource $image, integer $width, integer $targetWidth ) : void
$image resource Image resource
$width integer Original image width
$targetWidth integer Downsampled image width
Résultat void

instance() public static méthode

Instanciate an image adaptor
public static instance ( string $image ) : Image
$image string Image file
Résultat Image Instance reference

send() public méthode

Send the cached and possibly downsampled image
public send ( ) : void
Résultat void

squeeze() public static méthode

Squeeze a particular source file
public static squeeze ( string $source, string $target, string $breakpoint = SQUEEZR_BREAKPOINT, array &$errors = [] ) : string
$source string Source file
$target string Target file
$breakpoint string Breakpoint
$errors array Errors
Résultat string Result file path

Property Details

$_absoluteCacheImageDir protected_oe property

Parent directory of cached image file (absolute path)
protected string $_absoluteCacheImageDir
Résultat string

$_absoluteCacheImagePath protected_oe property

Cached image file (absolute path)
protected string $_absoluteCacheImagePath
Résultat string

$_absoluteImagePath protected_oe property

Requested image file (absolute path)
protected string $_absoluteImagePath
Résultat string

$_quantizers protected_oe static_oe property

Valid quantizers
protected static array $_quantizers
Résultat array

$_relativeImagePath protected_oe property

Requested image file (relative path to document root)
protected string $_relativeImagePath
Résultat string