Class CMS_image

Description

Class CMS_image

This script aimed to manage images files for crop and resize. it extends CMS_file It handle JPG, PNG and GIF formats and respect alpha channel or transparency of files

Located in /automne/classes/files/image.php (line 25)

CMS_grandFather
   |
   --CMS_file
      |
      --CMS_image
Class Constant Summary
Method Summary
 void __construct ( $name, [ $from = self::FILE_SYSTEM], [ $type = self::TYPE_FILE], string $name,, integer $from,, integer $type,)
 boolean crop ( $cropTop,  $cropBottom,  $cropLeft,  $cropRight, [ $saveToPathFS = ''], integer $cropTop,, integer $cropBottom,, integer $cropLeft,, integer $cropRight,, integer $saveToPathFS,)
 integer getHeight ()
 integer getWidth ()
 boolean resize ( $newSizeX,  $newSizeY, [ $saveToPathFS = ''], [ $keepRatio = true], [ $crop = false], integer $newSizeX,, integer $newSizeY,, integer $saveToPathFS,, boolean $keepRatio,, boolean $crop,)
 void _loadImageSize ()
Methods
Constructor __construct (line 62)

Constructor

void __construct ( $name, [ $from = self::FILE_SYSTEM], [ $type = self::TYPE_FILE], string $name,, integer $from,, integer $type,)
  • string $name,: the full filename of the file or dir
  • integer $from,: the file path is : self::FILE_SYSTEM or self::WEBROOT
  • integer $type,: the type of the current object : self::TYPE_FILE for a file, self::TYPE_DIRECTORY for a dir, false for undefined
  • $name
  • $from
  • $type

Redefinition of:
CMS_file::__construct()
Constructor
crop (line 257)

Crop current image from specified dimensions

  • return: true on success, false on failure
  • access: public
boolean crop ( $cropTop,  $cropBottom,  $cropLeft,  $cropRight, [ $saveToPathFS = ''], integer $cropTop,, integer $cropBottom,, integer $cropLeft,, integer $cropRight,, integer $saveToPathFS,)
  • integer $cropTop,: the top value of the crop in pixels
  • integer $cropBottom,: the bottom value of the crop in pixels
  • integer $cropLeft,: the left value of the crop in pixels
  • integer $cropRight,: the right value of the crop in pixels
  • integer $saveToPathFS,: save cropped image to given FS path instead of replacing current one
  • $cropTop
  • $cropBottom
  • $cropLeft
  • $cropRight
  • $saveToPathFS
getHeight (line 89)

Get current image height in pixels

  • return: : the current image height
  • access: public
integer getHeight ()
getWidth (line 76)

Get current image width in pixels

  • return: : the current image width
  • access: public
integer getWidth ()
resize (line 119)

Resize current image to a specified size

  • return: true on success, false on failure
  • access: public
boolean resize ( $newSizeX,  $newSizeY, [ $saveToPathFS = ''], [ $keepRatio = true], [ $crop = false], integer $newSizeX,, integer $newSizeY,, integer $saveToPathFS,, boolean $keepRatio,, boolean $crop,)
  • integer $newSizeX,: the new width size for the image in pixels
  • integer $newSizeY,: the new height size for the image in pixels
  • integer $saveToPathFS,: save resized image to given FS path instead of replacing current one
  • boolean $keepRatio,: keep current image ratio (default : true)
  • boolean $crop,: crop image if needed to respect ratio and image dimension queried (default : false)
  • $newSizeX
  • $newSizeY
  • $saveToPathFS
  • $keepRatio
  • $crop
_loadImageSize (line 102)

Load current image size from file

  • access: private
void _loadImageSize ()

Inherited Methods

Inherited From CMS_file

 CMS_file::__construct()
 CMS_file::checkUploadedFile()
 CMS_file::chmod()
 CMS_file::chmodFile()
 CMS_file::copyTo()
 CMS_file::delete()
 CMS_file::deleteFile()
 CMS_file::deltree()
 CMS_file::deltreeSimulation()
 CMS_file::download()
 CMS_file::downloadFile()
 CMS_file::exists()
 CMS_file::fileIsExecutable()
 CMS_file::getContent()
 CMS_file::getExtension()
 CMS_file::getFileIcon()
 CMS_file::getFileList()
 CMS_file::getFilename()
 CMS_file::getFilePath()
 CMS_file::getFilePerms()
 CMS_file::getFileSize()
 CMS_file::getMaxUploadFileSize()
 CMS_file::getName()
 CMS_file::getParent()
 CMS_file::getTmpPath()
 CMS_file::gzipfile()
 CMS_file::isDeletable()
 CMS_file::makeDir()
 CMS_file::makeExecutable()
 CMS_file::makeReadable()
 CMS_file::makeWritable()
 CMS_file::mimeContentType()
 CMS_file::moveTo()
 CMS_file::readContent()
 CMS_file::sendFiles()
 CMS_file::setContent()
 CMS_file::uploadFile()
 CMS_file::writeToPersistence()

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants
JPEG_QUALITY = 90 (line 32)

jpg quality used from 0 (min quality) to 100 (max quality)

  • access: public
PNG_COMPRESSION = 9 (line 38)

png compression used from 0 (max quality) to 9 (min quality)

  • access: public

Inherited Constants

Inherited from CMS_file

CMS_file::FILE_SYSTEM
CMS_file::TYPE_DIRECTORY
CMS_file::TYPE_FILE
CMS_file::UPLOAD_FILE_CANCELLED
CMS_file::UPLOAD_FILE_VALIDATION_FAILED
CMS_file::UPLOAD_SECURITY_ERROR
CMS_file::UPLOAD_UPLOAD_FAILED
CMS_file::UPLOAD_UPLOAD_LIMIT_EXCEEDED
CMS_file::UPLOAD_UPLOAD_STOPPED
CMS_file::WEBROOT

Inherited from CMS_grandFather

CMS_grandFather::ERROR_LOG
CMS_grandFather::SYSTEM_LABEL

Documentation generated on Wed, 15 Feb 2012 15:31:00 +0100 by phpDocumentor 1.4.3