Cheetah
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
ChWsbImageResize Class Reference

Public Member Functions

 __construct ()
 
 __clone ()
 
 getManager ()
 
 getError ()
 
 isAllowedImage ($sSrcImage)
 
 resize ($mixedImage, $sDstImage='')
 
 applyWatermark ($mixedImage, $sDstImage, $sWtrImage, $iTransparency, $sPosition='bottom-right', $sPositionOffsetX=0, $sPositionOffsetY=0, $sScaleFactor=0.2)
 
 grayscale ($mixedImage, $sDstImage='')
 
 setSize ($w, $h)
 
 removeCropOptions ()
 
 setAutoCrop ($b)
 
 setJpegOutput ($b)
 
 setJpegQuality ($i)
 
 setSquareResize ($b)
 
 isUsedGD ()
 
 _getImageSize ($sPath)
 
 getExifInfo ($sSrcImage, $bCreateLocalFileIfUrl=true)
 
 getAverageColor ($sSrcImage)
 
 crop ($iScaledWidth, $iScaledHeight, $x, $y, $iCroppedWidth, $iCroppedHeight, $iRotation, $sSrcImage, $sDstImage='')
 
 _grayscale ($sSrcImage, $sDstImage='')
 
 _resize ($sSrcImage, $sDstImage='')
 
 _applyWatermark ( $sSrcImage, $sDstImage, $sWtrImage, $iTransparency, $sPosition='bottom-right', $sPositionOffsetX=0, $sPositionOffsetY=0, $sScaleFactor=0.2)
 

Static Public Member Functions

static instance ()
 
static getImageSize ($sPath)
 

Public Attributes

 $h = 64
 size of destination image More...
 

Protected Attributes

 $w = 64
 
 $_isAutoCrop = false
 
 $_iJpegQuality = 90
 jpeg quality More...
 
 $_isSquareResize = false
 use smart resize, destination image will be exact Width x Height size More...
 
 $_isUseGD
 use GD library or command line ImagMagic utilites More...
 
 $_oManager
 Intervention Image Manager. More...
 
 $_sError
 Intervention Image Manager error string. More...
 

Detailed Description

Definition at line 28 of file ChWsbImageResize.php.

Constructor & Destructor Documentation

◆ __construct()

ChWsbImageResize::__construct ( )

Definition at line 38 of file ChWsbImageResize.php.

Member Function Documentation

◆ __clone()

ChWsbImageResize::__clone ( )

Prevent cloning the instance

Definition at line 51 of file ChWsbImageResize.php.

◆ _applyWatermark()

ChWsbImageResize::_applyWatermark (   $sSrcImage,
  $sDstImage,
  $sWtrImage,
  $iTransparency,
  $sPosition = 'bottom-right',
  $sPositionOffsetX = 0,
  $sPositionOffsetY = 0,
  $sScaleFactor = 0.2 
)

Definition at line 322 of file ChWsbImageResize.php.

◆ _getImageSize()

ChWsbImageResize::_getImageSize (   $sPath)

Definition at line 173 of file ChWsbImageResize.php.

◆ _grayscale()

ChWsbImageResize::_grayscale (   $sSrcImage,
  $sDstImage = '' 
)

Definition at line 272 of file ChWsbImageResize.php.

◆ _resize()

ChWsbImageResize::_resize (   $sSrcImage,
  $sDstImage = '' 
)

Definition at line 291 of file ChWsbImageResize.php.

◆ applyWatermark()

ChWsbImageResize::applyWatermark (   $mixedImage,
  $sDstImage,
  $sWtrImage,
  $iTransparency,
  $sPosition = 'bottom-right',
  $sPositionOffsetX = 0,
  $sPositionOffsetY = 0,
  $sScaleFactor = 0.2 
)

Definition at line 103 of file ChWsbImageResize.php.

◆ crop()

ChWsbImageResize::crop (   $iScaledWidth,
  $iScaledHeight,
  $x,
  $y,
  $iCroppedWidth,
  $iCroppedHeight,
  $iRotation,
  $sSrcImage,
  $sDstImage = '' 
)

Crop image

Parameters
$iScaledWidth- scaled img width
$iScaledHeight- scaled img height
$x- cropped area coord
$y- cropped area coord
$iCroppedWidth- cropped area width
$iCroppedHeight- cropped area height
$iRotation- img rotation
$sSrcImage- source image
$sDstImage- destination image, leave empty to overwrite $sSrcImage
Returns
true on success, false on error

Definition at line 242 of file ChWsbImageResize.php.

◆ getAverageColor()

ChWsbImageResize::getAverageColor (   $sSrcImage)

Definition at line 212 of file ChWsbImageResize.php.

◆ getError()

ChWsbImageResize::getError ( )

Definition at line 73 of file ChWsbImageResize.php.

◆ getExifInfo()

ChWsbImageResize::getExifInfo (   $sSrcImage,
  $bCreateLocalFileIfUrl = true 
)

Definition at line 186 of file ChWsbImageResize.php.

◆ getImageSize()

static ChWsbImageResize::getImageSize (   $sPath)
static

Definition at line 167 of file ChWsbImageResize.php.

◆ getManager()

ChWsbImageResize::getManager ( )

Definition at line 68 of file ChWsbImageResize.php.

◆ grayscale()

ChWsbImageResize::grayscale (   $mixedImage,
  $sDstImage = '' 
)

Definition at line 115 of file ChWsbImageResize.php.

◆ instance()

static ChWsbImageResize::instance ( )
static

Get singleton instance of the class

Definition at line 60 of file ChWsbImageResize.php.

◆ isAllowedImage()

ChWsbImageResize::isAllowedImage (   $sSrcImage)

Definition at line 78 of file ChWsbImageResize.php.

◆ isUsedGD()

ChWsbImageResize::isUsedGD ( )

Definition at line 162 of file ChWsbImageResize.php.

◆ removeCropOptions()

ChWsbImageResize::removeCropOptions ( )

Definition at line 134 of file ChWsbImageResize.php.

◆ resize()

ChWsbImageResize::resize (   $mixedImage,
  $sDstImage = '' 
)

Definition at line 90 of file ChWsbImageResize.php.

◆ setAutoCrop()

ChWsbImageResize::setAutoCrop (   $b)

Crop image to destination size with filling whole area of destination size

Definition at line 142 of file ChWsbImageResize.php.

◆ setJpegOutput()

ChWsbImageResize::setJpegOutput (   $b)

Definition at line 147 of file ChWsbImageResize.php.

◆ setJpegQuality()

ChWsbImageResize::setJpegQuality (   $i)

Definition at line 152 of file ChWsbImageResize.php.

◆ setSize()

ChWsbImageResize::setSize (   $w,
  $h 
)

Definition at line 128 of file ChWsbImageResize.php.

◆ setSquareResize()

ChWsbImageResize::setSquareResize (   $b)

Definition at line 157 of file ChWsbImageResize.php.

Member Data Documentation

◆ $_iJpegQuality

ChWsbImageResize::$_iJpegQuality = 90
protected

jpeg quality

Definition at line 32 of file ChWsbImageResize.php.

◆ $_isAutoCrop

ChWsbImageResize::$_isAutoCrop = false
protected

Definition at line 31 of file ChWsbImageResize.php.

◆ $_isSquareResize

ChWsbImageResize::$_isSquareResize = false
protected

use smart resize, destination image will be exact Width x Height size

Definition at line 33 of file ChWsbImageResize.php.

◆ $_isUseGD

ChWsbImageResize::$_isUseGD
protected

use GD library or command line ImagMagic utilites

Definition at line 34 of file ChWsbImageResize.php.

◆ $_oManager

ChWsbImageResize::$_oManager
protected

Intervention Image Manager.

Definition at line 35 of file ChWsbImageResize.php.

◆ $_sError

ChWsbImageResize::$_sError
protected

Intervention Image Manager error string.

Definition at line 36 of file ChWsbImageResize.php.

◆ $h

ChWsbImageResize::$h = 64

size of destination image

Definition at line 30 of file ChWsbImageResize.php.

◆ $w

ChWsbImageResize::$w = 64
protected

Definition at line 30 of file ChWsbImageResize.php.


The documentation for this class was generated from the following file: