Joomla Platform
13.1
Documentation des API du framework Joomla Platform
|
Fonctions membres publiques | |
__construct ($source=null) | |
generateThumbs ($thumbSizes, $creationMethod=self::SCALE_INSIDE) | |
createThumbs ($thumbSizes, $creationMethod=self::SCALE_INSIDE, $thumbsFolder=null) | |
crop ($width, $height, $left=null, $top=null, $createNew=true) | |
filter ($type, array $options=array()) | |
getHeight () | |
getWidth () | |
getPath () | |
isLoaded () | |
isTransparent () | |
loadFile ($path) | |
resize ($width, $height, $createNew=true, $scaleMethod=self::SCALE_INSIDE) | |
cropResize ($width, $height, $createNew=true) | |
rotate ($angle, $background=-1, $createNew=true) | |
toFile ($path, $type=IMAGETYPE_JPEG, array $options=array()) | |
destroy () | |
__destruct () |
Fonctions membres publiques statiques | |
static | getImageFileProperties ($path) |
Attributs publics | |
const | SCALE_FILL = 1 |
const | SCALE_INSIDE = 2 |
const | SCALE_OUTSIDE = 3 |
const | CROP = 4 |
const | CROP_RESIZE = 5 |
const | SCALE_FIT = 6 |
Fonctions membres protégées | |
getFilterInstance ($type) | |
prepareDimensions ($width, $height, $scaleMethod) | |
sanitizeHeight ($height, $width) | |
sanitizeOffset ($offset) | |
sanitizeWidth ($width, $height) |
Attributs protégés | |
$handle | |
$path = null |
Attributs protégés statiques | |
static | $formats = array() |
JImage::__construct | ( | $source = null | ) |
Class constructor.
mixed | $source | Either a file path for a source image or a GD resource handler for an image. |
RuntimeException |
Définition à la ligne 83 du fichier image.php.
Références JLog\add(), et JLog\ERROR.
JImage::__destruct | ( | ) |
Method to call the destroy() method one last time to free any memory when the object is unset
JImage::createThumbs | ( | $thumbSizes, | |
$creationMethod = self::SCALE_INSIDE , |
|||
$thumbsFolder = null |
|||
) |
Method to create thumbnails from the current image and save them to disk. It allows creation by resizing or croppping the original image.
mixed | $thumbSizes | string or array of strings. Example: $thumbSizes = array('150x75','250x150'); |
integer | $creationMethod | 1-3 resize $scaleMethod | 4 create croppping |
string | $thumbsFolder | destination thumbs folder. null generates a thumbs folder in the image folder |
LogicException | |
InvalidArgumentException |
Définition à la ligne 246 du fichier image.php.
JImage::crop | ( | $width, | |
$height, | |||
$left = null , |
|||
$top = null , |
|||
$createNew = true |
|||
) |
Method to crop the current image.
mixed | $width | The width of the image section to crop in pixels or a percentage. |
mixed | $height | The height of the image section to crop in pixels or a percentage. |
integer | $left | The number of pixels from the left to start cropping. |
integer | $top | The number of pixels from the top to start cropping. |
boolean | $createNew | If true the current image will be cloned, cropped and returned; else the current image will be cropped and returned. |
LogicException |
Définition à la ligne 315 du fichier image.php.
JImage::cropResize | ( | $width, | |
$height, | |||
$createNew = true |
|||
) |
Method to crop an image after resizing it to maintain proportions without having to do all the set up work.
integer | $width | The desired width of the image in pixels or a percentage. |
integer | $height | The desired height of the image in pixels or a percentage. |
integer | $createNew | If true the current image will be cloned, resized, cropped and returned. |
Définition à la ligne 742 du fichier image.php.
JImage::destroy | ( | ) |
JImage::filter | ( | $type, | |
array | $options = array() |
||
) |
Method to apply a filter to the image by type. Two examples are: grayscale and sketchy.
string | $type | The name of the image filter to apply. |
array | $options | An array of options for the filter. |
LogicException |
Définition à la ligne 404 du fichier image.php.
JImage::generateThumbs | ( | $thumbSizes, | |
$creationMethod = self::SCALE_INSIDE |
|||
) |
Method to generate thumbnails from the current image. It allows creation by resizing or cropping the original image.
mixed | $thumbSizes | String or array of strings. Example: $thumbSizes = array('150x75','250x150'); |
integer | $creationMethod | 1-3 resize $scaleMethod | 4 create croppping | 5 resize then crop |
LogicException | |
InvalidArgumentException |
Définition à la ligne 175 du fichier image.php.
|
protected |
Method to get an image filter instance of a specified type.
string | $type | The image filter type to get. |
RuntimeException |
Définition à la ligne 865 du fichier image.php.
Références JLog\add(), et JLog\ERROR.
JImage::getHeight | ( | ) |
Method to get the height of the image in pixels.
LogicException |
Définition à la ligne 429 du fichier image.php.
|
static |
Method to return a properties object for an image given a filesystem path. The result object has values for image width, height, type, attributes, mime type, bits, and channels.
string | $path | The filesystem path to the image for which to get properties. |
InvalidArgumentException | |
RuntimeException |
Définition à la ligne 129 du fichier image.php.
JImage::getPath | ( | ) |
Method to return the path
JImage::getWidth | ( | ) |
Method to get the width of the image in pixels.
LogicException |
Définition à la ligne 448 du fichier image.php.
JImage::isLoaded | ( | ) |
Method to determine whether or not an image has been loaded into the object.
Définition à la ligne 478 du fichier image.php.
JImage::isTransparent | ( | ) |
Method to determine whether or not the image has transparency.
LogicException |
Définition à la ligne 497 du fichier image.php.
JImage::loadFile | ( | $path | ) |
Method to load a file into the JImage object as the resource.
string | $path | The filesystem path to load as an image. |
InvalidArgumentException | |
RuntimeException |
Définition à la ligne 519 du fichier image.php.
Références JLog\add(), et JLog\ERROR.
|
protected |
Method to get the new dimensions for a resized image.
integer | $width | The width of the resized image in pixels. |
integer | $height | The height of the resized image in pixels. |
integer | $scaleMethod | The method to use for scaling |
InvalidArgumentException | If width, height or both given as zero |
Définition à la ligne 907 du fichier image.php.
JImage::resize | ( | $width, | |
$height, | |||
$createNew = true , |
|||
$scaleMethod = self::SCALE_INSIDE |
|||
) |
Method to resize the current image.
mixed | $width | The width of the resized image in pixels or a percentage. |
mixed | $height | The height of the resized image in pixels or a percentage. |
boolean | $createNew | If true the current image will be cloned, resized and returned; else the current image will be resized and returned. |
integer | $scaleMethod | Which method to use for scaling |
LogicException |
Définition à la ligne 645 du fichier image.php.
JImage::rotate | ( | $angle, | |
$background = -1 , |
|||
$createNew = true |
|||
) |
Method to rotate the current image.
mixed | $angle | The angle of rotation for the image |
integer | $background | The background color to use when areas are added due to rotation |
boolean | $createNew | If true the current image will be cloned, rotated and returned; else the current image will be rotated and returned. |
LogicException |
Définition à la ligne 772 du fichier image.php.
|
protected |
Method to sanitize a height value.
mixed | $height | The input height value to sanitize. |
mixed | $width | The input width value for reference. |
Définition à la ligne 956 du fichier image.php.
|
protected |
|
protected |
Method to sanitize a width value.
mixed | $width | The input width value to sanitize. |
mixed | $height | The input height value for reference. |
Définition à la ligne 999 du fichier image.php.
JImage::toFile | ( | $path, | |
$type = IMAGETYPE_JPEG , |
|||
array | $options = array() |
||
) |
Method to write the current image out to a file.
string | $path | The filesystem path to save the image. |
integer | $type | The image type to save the file as. |
array | $options | The image type options to use in saving the file. |
LogicException |
Définition à la ligne 831 du fichier image.php.