Varien_Image_Adapter_Abstract Class Reference

Inheritance diagram for Varien_Image_Adapter_Abstract:

Varien_Image_Adapter_Gd2

List of all members.

Public Member Functions

 open ($fileName)
 save ($destination=null, $newName=null)
 display ()
 resize ($width=null, $height=null)
 rotate ($angle)
 crop ($top=0, $left=0, $right=0, $bottom=0)
 watermark ($watermarkImage, $positionX=0, $positionY=0, $watermarkImageOpacity=30, $repeat=false)
 checkDependencies ()
 getMimeType ()
 getOriginalWidth ()
 getOriginalHeight ()
 setWatermarkPosition ($position)
 getWatermarkPosition ()
 setWatermarkWidth ($width)
 getWatermarkWidth ()
 setWatermarkHeigth ($heigth)
 getWatermarkHeigth ()
 keepAspectRatio ($value=null)
 keepFrame ($value=null)
 keepTransparency ($value=null)
 constrainOnly ($value=null)
 backgroundColor ($value=null)

Public Attributes

 $fileName = null
 $imageBackgroundColor = 0
const POSITION_TOP_LEFT = 'top-left'
const POSITION_TOP_RIGHT = 'top-right'
const POSITION_BOTTOM_LEFT = 'bottom-left'
const POSITION_BOTTOM_RIGHT = 'bottom-right'
const POSITION_STRETCH = 'stretch'
const POSITION_TILE = 'tile'

Protected Member Functions

 _getFileAttributes ()

Protected Attributes

 $_fileType = null
 $_fileName = null
 $_fileMimeType = null
 $_fileSrcName = null
 $_fileSrcPath = null
 $_imageHandler = null
 $_imageSrcWidth = null
 $_imageSrcHeight = null
 $_requiredExtensions = null
 $_watermarkPosition = null
 $_watermarkWidth = null
 $_watermarkHeigth = null
 $_keepAspectRatio
 $_keepFrame
 $_keepTransparency
 $_backgroundColor
 $_constrainOnly


Detailed Description

Definition at line 32 of file Abstract.php.


Member Function Documentation

_getFileAttributes (  )  [protected]

Definition at line 224 of file Abstract.php.

00225     {
00226         $pathinfo = pathinfo($this->_fileName);
00227 
00228         $this->_fileSrcPath = $pathinfo['dirname'];
00229         $this->_fileSrcName = $pathinfo['basename'];
00230     }

backgroundColor ( value = null  ) 

Get/set keepBackgroundColor

Parameters:
array $value
Returns:
array

Definition at line 208 of file Abstract.php.

00209     {
00210         if (null !== $value) {
00211             if ((!is_array($value)) || (3 !== count($value))) {
00212                 return;
00213             }
00214             foreach ($value as $color) {
00215                 if ((!is_integer($color)) || ($color < 0) || ($color > 255)) {
00216                     return;
00217                 }
00218             }
00219         }
00220         $this->_backgroundColor = $value;
00221         return $this->_backgroundColor;
00222     }

checkDependencies (  )  [abstract]

Reimplemented in Varien_Image_Adapter_Gd2.

constrainOnly ( value = null  ) 

Get/set constrainOnly

Parameters:
bool $value
Returns:
bool

Definition at line 194 of file Abstract.php.

00195     {
00196         if (null !== $value) {
00197             $this->_constrainOnly = (bool)$value;
00198         }
00199         return $this->_constrainOnly;
00200     }

crop ( top = 0,
left = 0,
right = 0,
bottom = 0 
) [abstract]

Reimplemented in Varien_Image_Adapter_Gd2.

display (  )  [abstract]

Reimplemented in Varien_Image_Adapter_Gd2.

getMimeType (  ) 

Definition at line 79 of file Abstract.php.

00080     {
00081         if( $this->_fileType ) {
00082             return $this->_fileType;
00083         } else {
00084             list($this->_imageSrcWidth, $this->_imageSrcHeight, $this->_fileType, ) = getimagesize($this->_fileName);
00085             $this->_fileMimeType = image_type_to_mime_type($this->_fileType);
00086             return $this->_fileMimeType;
00087         }
00088     }

getOriginalHeight (  ) 

Retrieve Original Image Height

Returns:
int|null

Definition at line 106 of file Abstract.php.

00107     {
00108         $this->getMimeType();
00109         return $this->_imageSrcHeight;
00110     }

getOriginalWidth (  ) 

Retrieve Original Image Width

Returns:
int|null

Definition at line 95 of file Abstract.php.

00096     {
00097         $this->getMimeType();
00098         return $this->_imageSrcWidth;
00099     }

getWatermarkHeigth (  ) 

Definition at line 140 of file Abstract.php.

00141     {
00142         return $this->_watermarkHeigth;
00143     }

getWatermarkPosition (  ) 

Definition at line 118 of file Abstract.php.

00119     {
00120         return $this->_watermarkPosition;
00121     }

getWatermarkWidth (  ) 

Definition at line 129 of file Abstract.php.

00130     {
00131         return $this->_watermarkWidth;
00132     }

keepAspectRatio ( value = null  ) 

Get/set keepAspectRatio

Parameters:
bool $value
Returns:
bool|Varien_Image_Adapter_Abstract

Definition at line 152 of file Abstract.php.

00153     {
00154         if (null !== $value) {
00155             $this->_keepAspectRatio = (bool)$value;
00156         }
00157         return $this->_keepAspectRatio;
00158     }

keepFrame ( value = null  ) 

Get/set keepFrame

Parameters:
bool $value
Returns:
bool

Definition at line 166 of file Abstract.php.

00167     {
00168         if (null !== $value) {
00169             $this->_keepFrame = (bool)$value;
00170         }
00171         return $this->_keepFrame;
00172     }

keepTransparency ( value = null  ) 

Get/set keepTransparency

Parameters:
bool $value
Returns:
bool

Definition at line 180 of file Abstract.php.

00181     {
00182         if (null !== $value) {
00183             $this->_keepTransparency = (bool)$value;
00184         }
00185         return $this->_keepTransparency;
00186     }

open ( fileName  )  [abstract]

Reimplemented in Varien_Image_Adapter_Gd2.

resize ( width = null,
height = null 
) [abstract]

Reimplemented in Varien_Image_Adapter_Gd2.

rotate ( angle  )  [abstract]

Reimplemented in Varien_Image_Adapter_Gd2.

save ( destination = null,
newName = null 
) [abstract]

Reimplemented in Varien_Image_Adapter_Gd2.

setWatermarkHeigth ( heigth  ) 

Definition at line 134 of file Abstract.php.

00135     {
00136         $this->_watermarkHeigth = $heigth;
00137         return $this;
00138     }

setWatermarkPosition ( position  ) 

Definition at line 112 of file Abstract.php.

00113     {
00114         $this->_watermarkPosition = $position;
00115         return $this;
00116     }

setWatermarkWidth ( width  ) 

Definition at line 123 of file Abstract.php.

00124     {
00125         $this->_watermarkWidth = $width;
00126         return $this;
00127     }

watermark ( watermarkImage,
positionX = 0,
positionY = 0,
watermarkImageOpacity = 30,
repeat = false 
) [abstract]

Reimplemented in Varien_Image_Adapter_Gd2.


Member Data Documentation

$_backgroundColor [protected]

Definition at line 60 of file Abstract.php.

$_constrainOnly [protected]

Definition at line 61 of file Abstract.php.

$_fileMimeType = null [protected]

Definition at line 46 of file Abstract.php.

$_fileName = null [protected]

Definition at line 45 of file Abstract.php.

$_fileSrcName = null [protected]

Definition at line 47 of file Abstract.php.

$_fileSrcPath = null [protected]

Definition at line 48 of file Abstract.php.

$_fileType = null [protected]

Definition at line 44 of file Abstract.php.

$_imageHandler = null [protected]

Definition at line 49 of file Abstract.php.

$_imageSrcHeight = null [protected]

Definition at line 51 of file Abstract.php.

$_imageSrcWidth = null [protected]

Definition at line 50 of file Abstract.php.

$_keepAspectRatio [protected]

Definition at line 57 of file Abstract.php.

$_keepFrame [protected]

Definition at line 58 of file Abstract.php.

$_keepTransparency [protected]

Definition at line 59 of file Abstract.php.

$_requiredExtensions = null [protected]

Reimplemented in Varien_Image_Adapter_Gd2.

Definition at line 52 of file Abstract.php.

$_watermarkHeigth = null [protected]

Definition at line 55 of file Abstract.php.

$_watermarkPosition = null [protected]

Definition at line 53 of file Abstract.php.

$_watermarkWidth = null [protected]

Definition at line 54 of file Abstract.php.

$fileName = null

Definition at line 34 of file Abstract.php.

$imageBackgroundColor = 0

Definition at line 35 of file Abstract.php.

const POSITION_BOTTOM_LEFT = 'bottom-left'

Definition at line 39 of file Abstract.php.

const POSITION_BOTTOM_RIGHT = 'bottom-right'

Definition at line 40 of file Abstract.php.

const POSITION_STRETCH = 'stretch'

Definition at line 41 of file Abstract.php.

const POSITION_TILE = 'tile'

Definition at line 42 of file Abstract.php.

const POSITION_TOP_LEFT = 'top-left'

Definition at line 37 of file Abstract.php.

const POSITION_TOP_RIGHT = 'top-right'

Definition at line 38 of file Abstract.php.


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

Generated on Sat Jul 4 17:25:03 2009 for Magento by  doxygen 1.5.8