Phundament App Class Reference
  • Package
  • Class
  • Tree

Packages

  • bootstrap
    • widgets
      • input
  • Image
  • None
  • p3admin
  • p3extensions
    • behaviors
    • commands
    • components
    • helpers
    • widgets
  • p3media
    • actions
    • controllers
    • models
  • p3pages
    • models
  • p3widgets
    • components
    • models
  • PHP
  • system
    • db
      • ar
    • gii
    • web
      • auth
      • helpers
      • widgets
  • yiiext
    • widgets
      • fancybox
      • lipsum
  • zii
    • widgets
      • grid

Classes

  • Image
  • Image_Driver
  • Image_GD_Driver
  • Image_ImageMagick_Driver

Class Image

Manipulate images using standard methods such as resize, crop, rotate, etc. This class must be re-initialized for every image you wish to manipulate.

$Id: Image.php 3809 2008-12-18 12:48:41Z OscarB $

Package: Image
Copyright: (c) 2007-2008 Kohana Team
License: http://kohanaphp.com/license.html
Author: Kohana Team
Located at phundament/p3extensions/components/image/Image.php

Methods summary

public static object
# factory( string $image, array $config = NULL )

Creates a new Image instance and returns it.

Creates a new Image instance and returns it.

Parameters

$image
string
filename of image
$config
array
non-default configurations

Returns

object
public
# __construct( string $image, array $config = NULL )

Creates a new image editor instance.

Creates a new image editor instance.

Parameters

$image
string
filename of image
$config
array
non-default configurations

Throws

Kohana_Exception
public mixed
# __get( string $property )

Handles retrieval of pre-save image properties

Handles retrieval of pre-save image properties

Parameters

$property
string
property name

Returns

mixed
public object
# resize( integer $width, integer $height, integer $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.

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.

Parameters

$width
integer
width
$height
integer
height
$master
integer
one of: Image::NONE, Image::AUTO, Image::WIDTH, Image::HEIGHT

Returns

object

Throws

Kohana_Exception
public object
# crop( integer $width, integer $height, integer $top = 'center', integer $left = 'center' )

Crop an image to a specific width and height. You may also set the top and left offset. This method is chainable.

Crop an image to a specific width and height. You may also set the top and left offset. This method is chainable.

Parameters

$width
integer
width
$height
integer
height
$top
integer
top offset, pixel value or one of: top, center, bottom
$left
integer
left offset, pixel value or one of: left, center, right

Returns

object

Throws

Kohana_Exception
public object
# rotate( integer $degrees )

Allows rotation of an image by 180 degrees clockwise or counter clockwise.

Allows rotation of an image by 180 degrees clockwise or counter clockwise.

Parameters

$degrees
integer
degrees

Returns

object
public object
# flip( integer $direction )

Flip an image horizontally or vertically.

Flip an image horizontally or vertically.

Parameters

$direction
integer
direction

Returns

object

Throws

Kohana_Exception
public object
# quality( integer $amount )

Change the quality of an image.

Change the quality of an image.

Parameters

$amount
integer
quality as a percentage

Returns

object
public object
# sharpen( integer $amount )

Sharpen an image.

Sharpen an image.

Parameters

$amount
integer
amount to sharpen, usually ~20 is ideal

Returns

object
public object
# save( string $new_image = FALSE, integer $chmod = 0644, boolean $keep_actions = FALSE )

Save the image to a new image or overwrite this image.

Save the image to a new image or overwrite this image.

Parameters

$new_image
string
new image filename
$chmod
integer
permissions for new image
$keep_actions
boolean
keep or discard image process actions

Returns

object

Throws

Kohana_Exception
public object
# render( boolean $keep_actions = FALSE )

Output the image to the browser.

Output the image to the browser.

Parameters

$keep_actions
boolean
keep or discard image process actions

Returns

object
protected boolean
# valid_size( string $type, mixed & $value )

Sanitize a given value type.

Sanitize a given value type.

Parameters

$type
string
type of property
$value
mixed
property value

Returns

boolean

Magic methods summary

Constants summary

integer NONE 1
#
integer AUTO 2
#
integer HEIGHT 3
#
integer WIDTH 4
#
integer HORIZONTAL 5
#
integer VERTICAL 6
#

Properties summary

public static array $allowed_types
#
protected mixed $driver
#
protected array $actions
#
protected string $image
#
Phundament App Class Reference API documentation generated by ApiGen 2.8.0