
Public Member Functions | |
| __construct ($file=null) | |
| resize ($width=null, $height=null) | |
| rotate ($degrees=null) | |
| flip ($type="h") | |
| crop ($crop=0) | |
| convert ($format="jpeg") | |
| addWatermark ($fileName=null, $position="BL", $absoluteX=null, $absoluteY=null) | |
| addReflection ($height="10%", $space=0, $color="#FFFFFF", $opacity=60) | |
| addText ($string="") | |
| setTextDirection ($direction) | |
| setTextColor ($color) | |
| setTextVisibilityPercent ($percent) | |
| setTextBackgroundColor ($color) | |
| setTextBackgroundVisPercent ($percent) | |
| setTextFont ($font) | |
| setTextPosition ($position="TR") | |
| setTextAbsoluteX ($absoluteX) | |
| setTextAbsoluteY ($absoluteY) | |
| setTextPadding ($padding) | |
| setTextPaddingX ($padding) | |
| setTextPaddingY ($padding) | |
| setTextAlignment ($alignment) | |
| setTextLineSpacing ($lineSpacing) | |
| convertToGreyscale () | |
| colorInvert () | |
| colorOverlay ($color="#FFFFFF", $percent=50) | |
| setContrast ($value=0) | |
| setBrightness ($value=0) | |
| setJpegQuality ($value=85) | |
| setBgColor ($color="#000000") | |
| __destruct () | |
Definition at line 33 of file Image.php.
| __construct | ( | $ | file = null |
) |
| __destruct | ( | ) |
| addReflection | ( | $ | height = "10%", |
|
| $ | space = 0, |
|||
| $ | color = "#FFFFFF", |
|||
| $ | opacity = 60 | |||
| ) |
$height sets the height of the reflection
Value is an integer in pixels, or a string which format can be in pixels or percentage. For instance, values can be : 40, '40', '40px' or '40'
$space sets the space between the source image and its relection
Value is an integer in pixels, which can be negative
$color sets the color of the reflection background.
Value is an hexadecimal color, such as FFFFFF
$opacity sets the initial opacity of the reflection
Value is an integer between 0 (no opacity) and 100 (full opacity).
Definition at line 183 of file Image.php.
00184 { 00185 if( intval($height) == 0 ) { 00186 return; 00187 } 00188 00189 $this->uploader->image_reflection_height = $height; 00190 $this->uploader->image_reflection_space = $space; 00191 $this->uploader->image_reflection_color = $color; 00192 $this->uploader->image_reflection_opacity = $opacity; 00193 }
| addText | ( | $ | string = "" |
) |
| addWatermark | ( | $ | fileName = null, |
|
| $ | position = "BL", |
|||
| $ | absoluteX = null, |
|||
| $ | absoluteY = null | |||
| ) |
Adds a watermark on the image
$fileName is a local image filename, relative or absolute. GIF, JPG and PNG are supported, as well as PNG alpha. $position sets the watermarkposition within the image
Value of positions is one or two out of 'TBLR' (top, bottom, left, right)
The positions are as following: TL T TR L R BL B BR
Default value is "BL" (bottom left)
Note that is $absoluteX and $absoluteY are used, $position has no effect
$absoluteX sets the watermark absolute X position within the image
Value is in pixels, representing the distance between the top of the image and the watermark If a negative value is used, it will represent the distance between the bottom of the image and the watermark
$absoluteY sets the twatermark absolute Y position within the image
Value is in pixels, representing the distance between the left of the image and the watermark If a negative value is used, it will represent the distance between the right of the image and the watermark
Definition at line 152 of file Image.php.
00153 { 00154 if( !isset($fileName) ) { 00155 return; 00156 } 00157 00158 $this->uploader->image_watermark = $fileName; 00159 $this->uploader->image_watermark_position = $position; 00160 $this->uploader->image_watermark_x = $absoluteX; 00161 $this->uploader->image_watermark_y = $absoluteY; 00162 }
| colorInvert | ( | ) |
| colorOverlay | ( | $ | color = "#FFFFFF", |
|
| $ | percent = 50 | |||
| ) |
Applies a colored overlay on the image
$color value is an hexadecimal color, such as FFFFFF
$percent value is a percentage, as an integer between 0 and 100
Definition at line 304 of file Image.php.
00305 { 00306 $this->uploader->image_overlay_color = $color; 00307 $this->uploader->image_overlay_percent = $percent; 00308 }
| convert | ( | $ | format = "jpeg" |
) |
| convertToGreyscale | ( | ) |
| crop | ( | $ | crop = 0 |
) |
Crops an image
$crop values are four dimensions, or two, or one (CSS style) They represent the amount cropped top, right, bottom and left. These values can either be in an array, or a space separated string. Each value can be in pixels (with or without 'px'), or percentage (of the source image)
For instance, are valid: $foo->crop(20) OR array(20); $foo->crop('20px') OR array('20px'); $foo->crop('20 40') OR array('20', 40); $foo->crop('-20 25') OR array(-20, '25'); $foo->crop('20px 25') OR array('20px', '25'); $foo->crop('20% 25') OR array('20', '25'); $foo->crop('20% 25% 10% 30') OR array('20', '25', '10', '30'); $foo->crop('20px 25px 2px 2px') OR array('20px', '25px', '2px', '2px'); $foo->crop('20 25% 40px 10') OR array(20, '25', '40px', '10');
If a value is negative, the image will be expanded, and the extra parts will be filled with black
Default value is NULL (no cropping)
Definition at line 107 of file Image.php.
| flip | ( | $ | type = "h" |
) |
| resize | ( | $ | width = null, |
|
| $ | height = null | |||
| ) |
Resizes an image Set parameters to the wanted (or maximum/minimum) width for the processed image, in pixels
Definition at line 45 of file Image.php.
00046 { 00047 $this->uploader->image_resize = true; 00048 00049 $this->uploader->image_ratio_x = ( $width == null ) ? true : false; 00050 $this->uploader->image_ratio_y = ( $height == null ) ? true : false; 00051 00052 $this->uploader->image_x = $width; 00053 $this->uploader->image_y = $height; 00054 }
| rotate | ( | $ | degrees = null |
) |
| setBgColor | ( | $ | color = "#000000" |
) |
| setBrightness | ( | $ | value = 0 |
) |
| setContrast | ( | $ | value = 0 |
) |
| setJpegQuality | ( | $ | value = 85 |
) |
| setTextAbsoluteX | ( | $ | absoluteX | ) |
| setTextAbsoluteY | ( | $ | absoluteY | ) |
| setTextAlignment | ( | $ | alignment | ) |
| setTextBackgroundColor | ( | $ | color | ) |
| setTextBackgroundVisPercent | ( | $ | percent | ) |
| setTextColor | ( | $ | color | ) |
| setTextDirection | ( | $ | direction | ) |
| setTextFont | ( | $ | font | ) |
| setTextLineSpacing | ( | $ | lineSpacing | ) |
| setTextPadding | ( | $ | padding | ) |
| setTextPaddingX | ( | $ | padding | ) |
| setTextPaddingY | ( | $ | padding | ) |
| setTextPosition | ( | $ | position = "TR" |
) |
| setTextVisibilityPercent | ( | $ | percent | ) |
1.5.8