Public Member Functions |
| __construct ($image, $config=NULL) |
| Creates a new image editor instance.
|
| __get ($property) |
| Handles retrieval of pre-save image properties.
|
| resize ($width, $height, $master=NULL) |
| Resize an image to a specific width and height.
|
| crop ($width, $height, $top= 'center', $left= 'center') |
| Crop an image to a specific width and height.
|
| rotate ($degrees) |
| Allows rotation of an image by 180 degrees clockwise or counter clockwise.
|
| flip ($direction) |
| Flip an image horizontally or vertically.
|
| quality ($amount) |
| Change the quality of an image.
|
| sharpen ($amount) |
| Sharpen an image.
|
| save ($new_image=FALSE, $chmod=0644, $keep_actions=FALSE) |
| Save the image to a new image or overwrite this image.
|
| render ($keep_actions=FALSE) |
| Output the image to the browser.
|
Static Public Member Functions |
static | factory ($image, $config=NULL) |
| Creates a new Image instance and returns it.
|
Public Attributes |
const | NONE = 1 |
const | AUTO = 2 |
const | HEIGHT = 3 |
const | WIDTH = 4 |
const | HORIZONTAL = 5 |
const | VERTICAL = 6 |
Static Public Attributes |
static | $allowed_types |
Protected Member Functions |
| valid_size ($type, &$value) |
| Sanitize a given value type.
|
Protected Attributes |
| $driver |
| $actions = array() |
| $image = '' |
Constructor & Destructor Documentation
Image::__construct |
( |
|
$image, |
|
|
|
$config = NULL |
|
) |
| |
Creates a new image editor instance.
- Exceptions
-
- Parameters
-
string | filename of image |
array | non-default configurations |
- Returns
- void
Member Function Documentation
Image::__get |
( |
|
$property | ) |
|
Handles retrieval of pre-save image properties.
- Parameters
-
- Returns
- mixed
Image::crop |
( |
|
$width, |
|
|
|
$height, |
|
|
|
$top = 'center' , |
|
|
|
$left = 'center' |
|
) |
| |
Crop an image to a specific width and height.
You may also set the top and left offset. This method is chainable.
- Exceptions
-
- Parameters
-
integer | width |
integer | height |
integer | top offset, pixel value or one of: top, center, bottom |
integer | left offset, pixel value or one of: left, center, right |
- Returns
- object
static Image::factory |
( |
|
$image, |
|
|
|
$config = NULL |
|
) |
| |
|
static |
Creates a new Image instance and returns it.
- Parameters
-
string | filename of image |
array | non-default configurations |
- Returns
- object
Image::flip |
( |
|
$direction | ) |
|
Flip an image horizontally or vertically.
- Exceptions
-
- Parameters
-
- Returns
- object
Image::quality |
( |
|
$amount | ) |
|
Change the quality of an image.
- Parameters
-
integer | quality as a percentage |
- Returns
- object
Image::render |
( |
|
$keep_actions = FALSE | ) |
|
Output the image to the browser.
- Parameters
-
boolean | keep or discard image process actions |
- Returns
- object
Image::resize |
( |
|
$width, |
|
|
|
$height, |
|
|
|
$master = NULL |
|
) |
| |
Resize an image to a specific width and height.
By default, Kohana will maintain the aspect ratio using the width as the master dimension. If you wish to use height as master dim, set $image->master_dim = Image::HEIGHT This method is chainable.
- Exceptions
-
- Parameters
-
integer | width |
integer | height |
integer | one of: Image::NONE, Image::AUTO, Image::WIDTH, Image::HEIGHT |
- Returns
- object
Image::rotate |
( |
|
$degrees | ) |
|
Allows rotation of an image by 180 degrees clockwise or counter clockwise.
- Parameters
-
- Returns
- object
Image::save |
( |
|
$new_image = FALSE , |
|
|
|
$chmod = 0644 , |
|
|
|
$keep_actions = FALSE |
|
) |
| |
Save the image to a new image or overwrite this image.
- Exceptions
-
- Parameters
-
string | new image filename |
integer | permissions for new image |
boolean | keep or discard image process actions |
- Returns
- object
Image::sharpen |
( |
|
$amount | ) |
|
Sharpen an image.
- Parameters
-
integer | amount to sharpen, usually ~20 is ideal |
- Returns
- object
Image::valid_size |
( |
|
$type, |
|
|
& |
$value |
|
) |
| |
|
protected |
Sanitize a given value type.
- Parameters
-
string | type of property |
mixed | property value |
- Returns
- boolean
Member Data Documentation
Initial value: array
(
IMAGETYPE_GIF => 'gif',
IMAGETYPE_JPEG => 'jpg',
IMAGETYPE_PNG => 'png',
IMAGETYPE_TIFF_II => 'tiff',
IMAGETYPE_TIFF_MM => 'tiff',
)
The documentation for this class was generated from the following file: