API - XOOPS 2.5.11 Beta 2
By monxoops.fr
|
Static Public Member Functions | |
static | version () |
static | path () |
static | checkGD () |
static | registerCustomMapper ($mapper_class_name, $mime_type, $extension) |
static | load ($source) |
static | loadFromFile ($uri) |
static | loadFromString ($string) |
static | loadFromHandle ($handle) |
static | loadFromUpload ($field_name, $index=null) |
static | createPaletteImage ($width, $height) |
static | createTrueColorImage ($width, $height) |
static | isValidImageHandle ($handle) |
static | assertValidImageHandle ($handle) |
Data Fields | |
const | SIDE_TOP_LEFT = 1 |
const | SIDE_TOP = 2 |
const | SIDE_TOP_RIGHT = 4 |
const | SIDE_RIGHT = 8 |
const | SIDE_BOTTOM_RIGHT = 16 |
const | SIDE_BOTTOM = 32 |
const | SIDE_BOTTOM_LEFT = 64 |
const | SIDE_LEFT = 128 |
const | SIDE_ALL = 255 |
Static Protected Attributes | |
static | $path = null |
|
static |
Throws exception if the handle isn't a valid GD resource
mixed | $handle | The variable to check |
|
static |
Checks whether the gd library is loaded, and throws an exception otherwise
|
static |
Factory method for creating a palette image
int | $width | |
int | $height |
|
static |
Factory method for creating a true-color image
int | $width | |
int | $height |
|
static |
Check whether the given handle is a valid GD resource
mixed | $handle | The variable to check |
|
static |
Loads an image from a file, URL, HTML input file field, binary string, or a valid image handle. The image format is auto-detected.
Currently supported formats: PNG, GIF, JPG, BMP, TGA, GD, GD2.
This function analyzes the input and decides whether to use WideImage::loadFromHandle(), WideImage::loadFromFile(), WideImage::loadFromUpload() or WideImage::loadFromString(), all of which you can also call directly to spare WideImage some guessing.
Arrays are supported for upload fields; it returns an array of loaded images. To load only a single image from an array field, use WideImage::loadFromUpload('img', $i), where $i is the index of the image you want to load.
$img = WideImage::load('http://url/image.png'); // image URL $img = WideImage::load('/path/to/image.png'); // local file path $img = WideImage::load('img'); // upload field name $img = WideImage::load(imagecreatetruecolor(10, 10)); // a GD resource $img = WideImage::load($image_data); // binary string containing image data
mixed | $source | File name, url, HTML file input field name, binary string, or a GD image resource |
|
static |
Create and load an image from a file or URL. The image format is auto-detected.
string | $uri | File or url |
|
static |
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.
$handle = imagecreatefrompng('file.png'); $image = WideImage::loadFromHandle($handle);
resource | $handle | A valid GD image resource |
|
static |
Create and load an image from a string. Format is auto-detected.
string | $string | Binary data, i.e. from BLOB field in the database |
|
static |
This method loads a file from the $_FILES array. The image format is auto-detected.
You only have to pass the field name as the parameter. For array fields, this function will return an array of image objects, unless you specify the $index parameter, which will load the desired image.
$field_name | Name of the key in $_FILES array | |
int | $index | The index of the file to load (if the input field is an array) |
|
static |
Returns the path to the library
|
static |
|
static |
Returns the library version
|
staticprotected |
const SIDE_ALL = 255 |
const SIDE_BOTTOM = 32 |
const SIDE_BOTTOM_LEFT = 64 |
const SIDE_BOTTOM_RIGHT = 16 |
const SIDE_LEFT = 128 |
const SIDE_RIGHT = 8 |
const SIDE_TOP = 2 |
const SIDE_TOP_LEFT = 1 |
const SIDE_TOP_RIGHT = 4 |