WideImage
[ class tree: WideImage ] [ index: WideImage ] [ all elements ]

Class: WideImage

Source Location: /WideImage.php

Class Overview


The gateway class for loading images and core library functions


Variables

Constants

Methods



Class Details

[line 55]
The gateway class for loading images and core library functions



[ Top ]


Class Variables

static $path =  null

[line 67]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


static method assertValidImageHandle [line 263]

static void assertValidImageHandle( mixed $handle)

Throws exception if the handle isn't a valid GD resource



Parameters:

mixed   $handle   The variable to check

[ Top ]

static method createPaletteImage [line 231]

static void createPaletteImage( int $width, int $height)

Factory method for creating a palette image



Parameters:

int   $width  
int   $height  

[ Top ]

static method createTrueColorImage [line 242]

static void createTrueColorImage( int $width, int $height)

Factory method for creating a true-color image



Parameters:

int   $width  
int   $height  

[ Top ]

static method isValidImageHandle [line 253]

static bool isValidImageHandle( mixed $handle)

Check whether the given handle is a valid GD resource



Parameters:

mixed   $handle   The variable to check

[ Top ]

static method load [line 108]

static WideImage_Image load( mixed $source, [string $format = null])

Loads an image from a file, URL, upload field, binary string, or a valid image handle. This function analyzes the input and decides whether to use WideImage::loadFromHandle(), WideImage::loadFromFile(), WideImage::loadFromUpload() or WideImage::loadFromString().

  1.  $img WideImage::load('http://url/image.png')// image URL
  2.  $img WideImage::load('/path/to/image.png')// local file path
  3.  $img WideImage::load('img')// upload field name
  4.  $img WideImage::load($image_resource)// a GD resource
  5.  $img WideImage::load($string)// binary string containing image data




Tags:

return:  WideImage_PaletteImage or WideImage_TrueColorImage instance


Parameters:

mixed   $source   File name, url, upload field name, binary string, or a GD image resource
string   $format   *DEPRECATED* Hint for image format

[ Top ]

static method loadFromFile [line 150]

static WideImage_Image loadFromFile( string $uri, [string $format = null])

Create and load an image from a file or URL. You can override the file format by specifying the second parameter.



Tags:

return:  WideImage_PaletteImage or WideImage_TrueColorImage instance


Parameters:

string   $uri   File or url
string   $format   *DEPRECATED* Format hint, usually not needed

[ Top ]

static method loadFromHandle [line 198]

static WideImage_Image loadFromHandle( resource $handle)

Create and load an image from an image handle.

Note: the resulting image object takes ownership of the passed handle. When the newly-created image object is destroyed, the handle is destroyed too, so it's not a valid image handle anymore. In order to preserve the handle for use after object destruction, you have to call WideImage_Image::releaseHandle() on the created image instance prior to its destruction.

  1.  $handle imagecreatefrompng('file.png');
  2.  $image WideImage::loadFromHandle($handle);




Tags:

return:  WideImage_PaletteImage or WideImage_TrueColorImage instance


Parameters:

resource   $handle   A valid GD image resource

[ Top ]

static method loadFromString [line 171]

static WideImage_Image loadFromString( string $string)

Create and load an image from a string. Format is auto-detected.



Tags:

return:  WideImage_PaletteImage or WideImage_TrueColorImage instance


Parameters:

string   $string   Binary data, i.e. from BLOB field in the database

[ Top ]

static method loadFromUpload [line 217]

static WideImage_Image loadFromUpload( $field_name $field_name)

This method loads a file from the $_FILES array.

You only have to pass the field name as the parameter.




Tags:

return:  The loaded image


Parameters:

$field_name   $field_name   Name of the key in $_FILES array

[ Top ]

static method path [line 84]

static string path( )

Returns the path to the library



[ Top ]

static method version [line 74]

static string version( )

Returns the library version



Tags:

return:  The library version


[ Top ]


Class Constants

SIDE_ALL =  255

[line 65]


[ Top ]

SIDE_BOTTOM =  32

[line 62]


[ Top ]

SIDE_BOTTOM_LEFT =  64

[line 63]


[ Top ]

SIDE_BOTTOM_RIGHT =  16

[line 61]


[ Top ]

SIDE_LEFT =  128

[line 64]


[ Top ]

SIDE_RIGHT =  8

[line 60]


[ Top ]

SIDE_TOP =  2

[line 58]


[ Top ]

SIDE_TOP_LEFT =  1

[line 57]


[ Top ]

SIDE_TOP_RIGHT =  4

[line 59]


[ Top ]



Documentation generated on Sat, 31 Jul 2010 20:37:59 +0200 by phpDocumentor 1.4.2