Class Mage_Catalog_Helper_Image

Description

Catalog image helper

Located in /Catalog/Helper/Image.php (line 32)

Mage_Core_Helper_Abstract
   |
   --Mage_Catalog_Helper_Image
Direct descendents
Class Description
Mage_XmlConnect_Helper_Catalog_Category_Image Catalog image helper
Variable Summary
Method Summary
void getAngle ()
void getImageFile ()
int|null getOriginalHeigh ()
int|null getOriginalHeight ()
int|null getOriginalWidth ()
void getPlaceholder ()
void getProduct ()
string getWatermark ()
string getWatermarkSize ()
void init (Mage_Catalog_Model_Product $product,  $attributeName, [ $imageFile = null])
Mage_Catalog_Helper_Image keepFrame (bool $flag, [array $position = array('center', 'middle')])
Mage_Catalog_Helper_Image keepTransparency (bool $flag, [int $alphaOpacity = null])
array parseSize ( $string)
void placeholder ( $fileName)
Mage_Catalog_Helper_Image resize (int $width, [int $height = null])
void rotate ( $angle)
void setAngle ( $angle)
void setImageFile ( $file)
void setProduct ( $product)
bool validateUploadFile (string $filePath)
Mage_Catalog_Helper_Image watermark (string $fileName, string $position, [string $size = null], [int $imageOpacity = null])
void _reset ()
void __toString ()
Variables
mixed $_angle (line 37)
  • access: protected
mixed $_imageFile (line 45)
  • access: protected
mixed $_model (line 34)
  • access: protected
mixed $_placeholder (line 46)
  • access: protected
mixed $_product (line 44)
  • access: protected
mixed $_scheduleResize = false (line 35)
  • access: protected
mixed $_scheduleRotate = false (line 36)
  • access: protected
mixed $_watermark (line 39)
  • access: protected
mixed $_watermarkImageOpacity (line 42)
  • access: protected
mixed $_watermarkPosition (line 40)
  • access: protected
mixed $_watermarkSize (line 41)
  • access: protected

Inherited Variables

Inherited from Mage_Core_Helper_Abstract

Mage_Core_Helper_Abstract::$_layout
Mage_Core_Helper_Abstract::$_moduleName
Mage_Core_Helper_Abstract::$_request
Methods
backgroundColor (line 191)

Set color to fill image frame with.

Applicable before calling resize() The keepTransparency(true) overrides this (if image has transparent color) It is white by default.

Mage_Catalog_Helper_Image backgroundColor (array $colorRGB)
  • array $colorRGB
constrainOnly (line 175)

Guarantee, that image picture will not be bigger, than it was.

Applicable before calling resize() It is false by default

  • access: public
Mage_Catalog_Helper_Image constrainOnly (bool $flag)
  • bool $flag
getAngle (line 301)
  • access: protected
void getAngle ()
getImageFile (line 420)
  • access: protected
void getImageFile ()
getOriginalHeigh (line 458)

Retrieve original image height

  • deprecated:
  • access: public
int|null getOriginalHeigh ()
getOriginalHeight (line 468)

Retrieve original image height

  • access: public
int|null getOriginalHeight ()
getOriginalSizeArray (line 479)

Retrieve Original image size as array

  1. - width, 1 - height

  • access: public
array getOriginalSizeArray ()
getOriginalWidth (line 447)

Retrieve original image width

  • access: public
int|null getOriginalWidth ()
getPlaceholder (line 233)
  • access: public
void getPlaceholder ()

Redefined in descendants as:
getProduct (line 409)
  • access: protected
void getProduct ()
getWatermark (line 324)

Get watermark file name

  • access: protected
string getWatermark ()
getWatermarkImageOpacity (line 394)

Get watermark image opacity

  • access: protected
int getWatermarkImageOpacity ()
getWatermarkPosition (line 347)

Get watermark position

  • access: protected
string getWatermarkPosition ()
getWatermarkSize (line 371)

Get watermark size

  • access: protected
string getWatermarkSize ()
init (line 66)
  • access: public
void init (Mage_Catalog_Model_Product $product,  $attributeName, [ $imageFile = null])

Redefined in descendants as:
keepAspectRatio (line 125)

Guarantee, that image picture width/height will not be distorted.

Applicable before calling resize() It is true by default.

Mage_Catalog_Helper_Image keepAspectRatio (bool $flag)
  • bool $flag
keepFrame (line 143)

Guarantee, that image will have dimensions, set in $width/$height Applicable before calling resize() Not applicable, if keepAspectRatio(false)

$position - TODO, not used for now - picture position inside the frame.

Mage_Catalog_Helper_Image keepFrame (bool $flag, [array $position = array('center', 'middle')])
  • bool $flag
  • array $position
keepTransparency (line 161)

Guarantee, that image will not lose transparency if any.

Applicable before calling resize() It is true by default.

$alphaOpacity - TODO, not used for now

Mage_Catalog_Helper_Image keepTransparency (bool $flag, [int $alphaOpacity = null])
  • bool $flag
  • int $alphaOpacity
parseSize (line 430)

Enter description here...

  • access: protected
array parseSize ( $string)
  • $string
placeholder (line 228)
  • access: public
void placeholder ( $fileName)
  • $fileName
resize (line 97)

Schedule resize of the image $width *or* $height can be null - in this case, lacking dimension will be calculated.

Mage_Catalog_Helper_Image resize (int $width, [int $height = null])
  • int $width
  • int $height
rotate (line 201)
  • access: public
void rotate ( $angle)
  • $angle
setAngle (line 295)
  • access: protected
void setAngle ( $angle)
  • $angle
setImageFile (line 414)
  • access: protected
void setImageFile ( $file)
  • $file
setProduct (line 403)
  • access: protected
void setProduct ( $product)
  • $product
setQuality (line 110)

Set image quality, values in percentage from 0 to 100

  • access: public
Mage_Catalog_Helper_Image setQuality (int $quality)
  • int $quality
setWatermark (line 312)

Set watermark file name

  • access: protected
Mage_Catalog_Helper_Image setWatermark (string $watermark)
  • string $watermark
setWatermarkImageOpacity (line 382)

Set watermark image opacity

  • access: public
Mage_Catalog_Helper_Image setWatermarkImageOpacity (int $imageOpacity)
  • int $imageOpacity
setWatermarkPosition (line 335)

Set watermark position

  • access: protected
Mage_Catalog_Helper_Image setWatermarkPosition (string $position)
  • string $position
setWatermarkSize (line 359)

Set watermark size param size in format 100x200

  • access: public
Mage_Catalog_Helper_Image setWatermarkSize (string $size)
  • string $size
validateUploadFile (line 494)

Check - is this file an image

  • access: public
bool validateUploadFile (string $filePath)
  • string $filePath
watermark (line 219)

Add watermark to image size param in format 100x200

  • access: public
Mage_Catalog_Helper_Image watermark (string $fileName, string $position, [string $size = null], [int $imageOpacity = null])
  • string $fileName
  • string $position
  • string $size
  • int $imageOpacity
_getModel (line 290)

Enter description here...

  • access: protected
_reset (line 51)

Reset all previos data

  • access: protected
void _reset ()
_setModel (line 279)

Enter description here...

  • access: protected
Mage_Catalog_Helper_Image _setModel ( $model)
  • $model
__toString (line 242)
  • access: public
void __toString ()

Inherited Methods

Inherited From Mage_Core_Helper_Abstract

Mage_Core_Helper_Abstract::escapeHtml()
Mage_Core_Helper_Abstract::escapeUrl()
Mage_Core_Helper_Abstract::getLayout()
Mage_Core_Helper_Abstract::htmlEscape()
Mage_Core_Helper_Abstract::isModuleEnabled()
Mage_Core_Helper_Abstract::isModuleOutputEnabled()
Mage_Core_Helper_Abstract::jsQuoteEscape()
Mage_Core_Helper_Abstract::setLayout()
Mage_Core_Helper_Abstract::stripTags()
Mage_Core_Helper_Abstract::translateArray()
Mage_Core_Helper_Abstract::urlDecode()
Mage_Core_Helper_Abstract::urlEncode()
Mage_Core_Helper_Abstract::urlEscape()
Mage_Core_Helper_Abstract::_cleanCache()
Mage_Core_Helper_Abstract::_getModuleName()
Mage_Core_Helper_Abstract::_getRequest()
Mage_Core_Helper_Abstract::_getUrl()
Mage_Core_Helper_Abstract::_loadCache()
Mage_Core_Helper_Abstract::_removeCache()
Mage_Core_Helper_Abstract::_saveCache()
Mage_Core_Helper_Abstract::__()

Documentation generated on Fri, 11 Feb 2011 17:06:22 +0200 by phpDocumentor 1.4.3