Class OCSP_IMAGE

Description

Located in /common/OCSP_IMAGE.phpclass (line 28)

OCSP_FILE
   |
   --OCSP_IMAGE
Class Constant Summary
 CLASS_SRC_FILE = __FILE__
Variable Summary
 int $height
 int $minWidth
 resource $myImgRes
 int $type
 int $width
Method Summary
 void clearCache ([boolean $debug = False])
 void delete ()
 boolean generateCacheFile (int $width, int $height, [boolean $enlarge = False], [boolean $debug = False])
 string getCacheFilePath (int $width, int $height, [boolean $autoCreate = True], [boolean $debug = False])
 boolean getFitSize ( &$width,  &$height, [boolean $enlarge = False], [ $debug = False], int $width, int $height)
 int getHeight ()
 int getImgType ()
 string getMimeType ([int $aType = 0])
 string getTypeFileExt ([int $aType = 0])
 int getWidth ()
 boolean output ([int $width = 0], [int $height = 0], [boolean $useCache = True], [boolean $enlarge = False], [boolean $debug = False])
 boolean resize (int $width, int $height, [boolean $debug = False])
 boolean res_create ()
 void res_free ()
 boolean res_get ([int $asType = 0])
 boolean res_resize (int $width, int $height)
 int res_saveAs ([string $fileName = ""], [int $asType = 0], [bool $testType = False])
 bool setFile (string $file, bool 1)
 void setMinHeight (int $height)
 void setMinWidth (int $width)
Variables
int $height (line 53)
  • access: protected
int $minHeight = 1 (line 67)

minimal width when resizing

  • access: protected
int $minWidth = 1 (line 60)

minimal width when resizing

  • access: protected
resource $myImgRes = NULL (line 80)
  • access: protected
int $type (line 74)
  • access: protected
int $width (line 47)
  • access: protected

Inherited Variables

Inherited from OCSP_FILE

OCSP_FILE::$fileExists
OCSP_FILE::$imagesize
OCSP_FILE::$myFileName
OCSP_FILE::$myFilePath
Methods
clearCache (line 576)

removes the cache files

  • access: public
void clearCache ([boolean $debug = False])
  • boolean $debug
delete (line 606)

deletes the file

  • access: public
void delete ()

Redefinition of:
OCSP_FILE::delete()
deletes the file
generateCacheFile (line 554)

generates a cahce file if the image does not fit otherwithe returns false

NOTE does not free the resource

  • access: protected
boolean generateCacheFile (int $width, int $height, [boolean $enlarge = False], [boolean $debug = False])
  • int $width
  • int $height
  • boolean $enlarge
  • boolean $debug
getCacheFilePath (line 527)
  • access: protected
string getCacheFilePath (int $width, int $height, [boolean $autoCreate = True], [boolean $debug = False])
  • int $width
  • int $height
  • boolean $autoCreate
  • boolean $debug
getFitSize (line 182)

calculates the width and height the image must have to fit into the $with and $height

  • version: pk-07-11-27 (return value)
  • version: pk-07-11-27 (0 values of $width and $height)
  • access: public
boolean getFitSize ( &$width,  &$height, [boolean $enlarge = False], [ $debug = False], int $width, int $height)
  • int $width
  • int $height
  • boolean $enlarge
  • &$width
  • &$height
  • $debug
getHeight (line 134)
  • access: public
int getHeight ()
getImgType (line 116)
int getImgType ()
getMimeType (line 265)

returns the mimetype of the image

  • todo: implementation for other types then gif,jpeg and png
  • access: public
string getMimeType ([int $aType = 0])
  • int $aType: (if !intval this->type is used)

Redefinition of:
OCSP_FILE::getMimeType()
returns the mimetype of
getTypeFileExt (line 288)

returns the Fileextension of the image type

  • todo: implementation for other types then gif,jpeg and png
  • access: public
string getTypeFileExt ([int $aType = 0])
  • int $aType: (if !intval this->type is used)
getWidth (line 125)
  • access: public
int getWidth ()
output (line 463)

echos the image with headers

  • return: if success
  • access: public
boolean output ([int $width = 0], [int $height = 0], [boolean $useCache = True], [boolean $enlarge = False], [boolean $debug = False])
  • int $width
  • int $height
  • boolean $useCache
  • boolean $enlarge
  • boolean $debug
resize (line 243)

resize the image and overwrites the original location

  • access: public
boolean resize (int $width, int $height, [boolean $debug = False])
  • int $width
  • int $height
  • boolean $debug
res_create (line 318)

creates the image from the source (if file exists)

  • todo: gd-check
  • todo: implementation for other types then gif,jpeg and png
  • access: public
boolean res_create ()
res_free (line 443)

frees myImgRes

  • access: public
void res_free ()
res_get (line 382)

returns the resource for output

  • access: public
boolean res_get ([int $asType = 0])
  • int $asType: 0=same as image
res_resize (line 348)

resizes the resource to width and height

  • access: public
boolean res_resize (int $width, int $height)
  • int $width
  • int $height
res_saveAs (line 404)

saves the resource

  • return: (type number)
  • access: public
int res_saveAs ([string $fileName = ""], [int $asType = 0], [bool $testType = False])
  • string $fileName: (empty will overwrite the image)
  • int $asType: 0=same as image
  • bool $testType: (if true and imagexxx fails the next one is tried)
setFile (line 99)

sets the image file to $file

if $file does not exists $OCSP_CONF['PROJECTPATH'].$file and $_SERVER['DOCUMENT_ROOT'] is also checked

  • access: public
bool setFile (string $file, bool 1)
  • string $file
  • bool 1: debug

Redefinition of:
OCSP_FILE::setFile()
sets myFilePath
setMinHeight (line 158)

sets the minimum height for resize

  • access: public
void setMinHeight (int $height)
  • int $height
setMinWidth (line 145)

sets the minimum width for resize

  • access: public
void setMinWidth (int $width)
  • int $width

Inherited Methods

Inherited From OCSP_FILE

 OCSP_FILE::__construct()
 OCSP_FILE::checkFileName()
 OCSP_FILE::checkFilePath()
 OCSP_FILE::delete()
 OCSP_FILE::factoryFromUpload()
 OCSP_FILE::getFile()
 OCSP_FILE::getFilePath()
 OCSP_FILE::getImagesize()
 OCSP_FILE::getMimeType()
 OCSP_FILE::getSize()
 OCSP_FILE::isAbsoultePath()
 OCSP_FILE::isFile()
 OCSP_FILE::isImage()
 OCSP_FILE::passthru()
 OCSP_FILE::setFile()
 OCSP_FILE::setFromUplaod()
Class Constants
CLASS_SRC_FILE = __FILE__ (line 37)

Inherited Constants

Inherited from OCSP_FILE

OCSP_FILE::CLASS_SRC_FILE

Documentation generated on Thu, 08 Jan 2009 17:46:53 +0100 by phpDocumentor 1.4.0a2