PHP Class CampGetImage

Mostrar archivo Open project: sourcefabric/newscoop

Public Methods

Method Description
ExitError ( string $p_errorMessage ) Writes the given error message and exit.
__construct ( integer $p_imageId, integer $p_imageRatio = 100, integer $p_imageWidth, integer $p_imageHeight, $p_imageCrop = null, $p_resizeCrop = null ) Class constructor.
getSourcePath ( ) Returns path to the local image file.
getTargetPath ( ) Returns path to the local image derivate file.
setSourcePath ( ) Sets path to the local image file.

Private Methods

Method Description
CheckLocalFile ( string $p_imagePath ) Checkes if local file exists
CheckRemoteFile ( string $p_imageUrl ) Checkes if remote file exists
CropImage ( ) crops image
CropResizedImage ( resource $p_im ) crops resized image to fit size
GetEnding ( ) : string Create an proper file ending for given ContenType
GetHeaders ( )
GetImage ( string $p_imageId ) Receives image name, type and url if any from DB.
MkdirRecursive ( string $p_dir ) : boolean Create an directory tree.
PushImage ( ) Sends headers and output image Send image to resize if need
ReadImage ( string $p_ending ) Reads image from a local or remote file.
ResizeImage ( resource $p_im ) resizes image
cacheHasExpired ( )
createImage ( $p_target = null )
getLocalFileName ( ) : string Return an local filename.
imageCacheHandler ( ) : unknown Create the cached version of an image.
removeCachedImage ( )
sendCachedImage ( )

Method Details

ExitError() public method

Writes the given error message and exit.
public ExitError ( string $p_errorMessage )
$p_errorMessage string

__construct() public method

Class constructor.
public __construct ( integer $p_imageId, integer $p_imageRatio = 100, integer $p_imageWidth, integer $p_imageHeight, $p_imageCrop = null, $p_resizeCrop = null )
$p_imageId integer The image identifier
$p_imageRatio integer The ratio for image resize
$p_imageWidth integer The max width for image resize
$p_imageHeight integer The max height for image resize

getSourcePath() public method

Returns path to the local image file.
public getSourcePath ( )

getTargetPath() public method

Returns path to the local image derivate file.
public getTargetPath ( )

setSourcePath() public method

Sets path to the local image file.
public setSourcePath ( )