Joomla CMS
3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
|
Fonctions membres publiques | |
__construct ($source=null) | |
getHandle () | |
getLogger () | |
setLogger (LoggerInterface $logger) | |
getOrientation () | |
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) | |
flip ($mode, $createNew=true) | |
watermark (Image $watermark, $transparency=50, $bottomMargin=0, $rightMargin=0) | |
toFile ($path, $type=IMAGETYPE_JPEG, array $options=array()) | |
destroy () | |
__destruct () | |
setThumbnailGenerate ($quality=true) | |
Fonctions membres publiques statiques | |
static | getImageFileProperties ($path) |
Champs de données | |
const | SCALE_FILL = 1 |
const | SCALE_INSIDE = 2 |
const | SCALE_OUTSIDE = 3 |
const | CROP = 4 |
const | CROP_RESIZE = 5 |
const | SCALE_FIT = 6 |
const | ORIENTATION_LANDSCAPE = 'landscape' |
const | ORIENTATION_PORTRAIT = 'portrait' |
const | ORIENTATION_SQUARE = 'square' |
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 | |
$logger | |
$generateBestQuality = true | |
Attributs protégés statiques | |
static | $formats = array() |
Fonctions membres privées | |
isValidImage ($handle) | |
Fonctions membres privées statiques | |
static | getOrientationString ($width, $height) |
__construct | ( | $source = null | ) |
Class constructor.
mixed | $source | Either a file path for a source image or a GD resource handler for an image. |
Références $info, elseif, Image\isValidImage(), et Image\loadFile().
__destruct | ( | ) |
Method to call the destroy() method one last time to free any memory when the object is unset
Références Image\destroy().
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 cropping the original image.
mixed | $thumbSizes | string or array of strings. Example: $thumbSizes = array('150x75','250x150'); |
integer | $creationMethod | 1-3 resize $scaleMethod | 4 create cropping |
string | $thumbsFolder | destination thumbs folder. null generates a thumbs folder in the image folder |
Références Image\generateThumbs(), Image\getPath(), Image\isLoaded(), et null.
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. |
Références $color, Image\$handle, $height, $width, Image\destroy(), Image\getHandle(), Image\getHeight(), Image\getWidth(), Image\isTransparent(), null, Image\sanitizeHeight(), Image\sanitizeOffset(), et Image\sanitizeWidth().
Référencé par Image\generateThumbs().
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. |
Références $height, $width, Image\getHeight(), Image\getWidth(), null, Image\resize(), Image\sanitizeHeight(), et Image\sanitizeWidth().
Référencé par Image\generateThumbs().
destroy | ( | ) |
Method to destroy an image handle and free the memory associated with the handle
Références Image\getHandle(), et Image\isLoaded().
Référencé par Image\__destruct(), Image\crop(), Image\flip(), Image\loadFile(), Image\resize(), et Image\rotate().
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. |
Références $filter, $options, $type, Image\getFilterInstance(), et Image\isLoaded().
flip | ( | $mode, | |
$createNew = true |
|||
) |
Method to flip the current image.
integer | $mode | The flip mode for flipping the image https://www.php.net/imageflip#refsect1-function.imageflip-parameters |
boolean | $createNew | If true the current image will be cloned, flipped and returned; else the current image will be flipped and returned. |
Références Image\$handle, $mode, Image\destroy(), Image\getHandle(), Image\getHeight(), et Image\getWidth().
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 cropping | 5 resize then crop |
Références Image\crop(), Image\cropResize(), Image\isLoaded(), null, et Image\resize().
Référencé par Image\createThumbs().
|
protected |
Method to get an image filter instance of a specified type.
string | $type | The image filter type to get. |
Références $className, $type, Image\getHandle(), et Image\getLogger().
Référencé par Image\filter().
getHandle | ( | ) |
Get the image resource handle
Références Image\$handle, et Image\isLoaded().
Référencé par Image\crop(), Image\destroy(), Image\flip(), Image\getFilterInstance(), Image\getHeight(), Image\getWidth(), Image\isTransparent(), Image\resize(), Image\rotate(), Image\toFile(), et Image\watermark().
getHeight | ( | ) |
Method to get the height of the image in pixels.
Références Image\getHandle().
Référencé par Image\crop(), Image\cropResize(), Image\flip(), Image\getOrientation(), Image\prepareDimensions(), Image\resize(), Image\rotate(), Image\sanitizeHeight(), et Image\watermark().
|
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. |
Références $info, Image\$path, et null.
getLogger | ( | ) |
Get the logger.
Références Image\$logger.
Référencé par Image\getFilterInstance(), et Image\loadFile().
getOrientation | ( | ) |
Method to detect whether an image's orientation is landscape, portrait or square.
The orientation will be returned as a string.
Références Image\getHeight(), Image\getWidth(), et Image\isLoaded().
|
staticprivate |
getPath | ( | ) |
Method to return the path
Références Image\$path.
Référencé par Image\createThumbs().
getWidth | ( | ) |
Method to get the width of the image in pixels.
Références Image\getHandle().
Référencé par Image\crop(), Image\cropResize(), Image\flip(), Image\getOrientation(), Image\prepareDimensions(), Image\rotate(), Image\sanitizeWidth(), et Image\watermark().
isLoaded | ( | ) |
Method to determine whether or not an image has been loaded into the object.
Références Image\isValidImage().
Référencé par Image\createThumbs(), Image\destroy(), Image\filter(), Image\generateThumbs(), Image\getHandle(), et Image\getOrientation().
isTransparent | ( | ) |
Method to determine whether or not the image has transparency.
Références Image\getHandle().
Référencé par Image\crop(), et Image\resize().
|
private |
mixed | $handle | A potential image handle |
Références Image\$handle.
Référencé par Image\__construct(), Image\isLoaded(), et Image\loadFile().
loadFile | ( | $path | ) |
Method to load a file into the Image object as the resource.
string | $path | The filesystem path to load as an image. |
Références Image\$handle, Image\$path, Image\destroy(), Image\getLogger(), et Image\isValidImage().
Référencé par Image\__construct().
|
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 |
Références $height, $width, Image\getHeight(), et Image\getWidth().
Référencé par Image\resize().
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 |
Références $color, Image\$handle, $height, $offset, $width, Image\destroy(), Image\getHandle(), Image\getHeight(), Image\isTransparent(), Image\prepareDimensions(), Image\sanitizeHeight(), et Image\sanitizeWidth().
Référencé par Image\cropResize(), et Image\generateThumbs().
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. |
Références Image\$handle, Image\destroy(), Image\getHandle(), Image\getHeight(), et Image\getWidth().
|
protected |
Method to sanitize a height value.
mixed | $height | The input height value to sanitize. |
mixed | $width | The input width value for reference. |
Références $height, $width, Image\getHeight(), et null.
Référencé par Image\crop(), Image\cropResize(), et Image\resize().
|
protected |
Method to sanitize an offset value like left or top.
mixed | $offset | An offset value. |
Références $offset.
Référencé par Image\crop().
|
protected |
Method to sanitize a width value.
mixed | $width | The input width value to sanitize. |
mixed | $height | The input height value for reference. |
Références $height, $width, Image\getWidth(), et null.
Référencé par Image\crop(), Image\cropResize(), et Image\resize().
setLogger | ( | LoggerInterface | $logger | ) |
Sets a logger instance on the object
LoggerInterface | $logger | A PSR-3 compliant logger. |
Implémente LoggerAwareInterface.
Références Image\$logger.
setThumbnailGenerate | ( | $quality = true | ) |
Method for set option of generate thumbnail method
boolean | $quality | True for best quality. False for best speed. |
toFile | ( | $path, | |
$type = IMAGETYPE_JPEG , |
|||
array | $options = array() |
||
) |
Method to write the current image out to a file or output directly.
mixed | $path | The filesystem path to save the image. When null, the raw image stream will be outputted directly. |
integer | $type | The image type to save the file as. |
array | $options | The image type options to use in saving the file. For PNG and JPEG formats use quality key to set compression level (0..9 and 0..100) |
Références $options, Image\$path, $type, et Image\getHandle().
watermark | ( | Image | $watermark, |
$transparency = 50 , |
|||
$bottomMargin = 0 , |
|||
$rightMargin = 0 |
|||
) |
Watermark the image
Image | $watermark | The Image object containing the watermark graphic |
integer | $transparency | The transparency to use for the watermark graphic |
integer | $bottomMargin | The margin from the bottom of this image |
integer | $rightMargin | The margin from the right side of this image |
Références Image\getHandle(), Image\getHeight(), et Image\getWidth().
|
staticprotected |
|
protected |
|
protected |
Référencé par Image\crop(), Image\flip(), Image\getHandle(), Image\isValidImage(), Image\loadFile(), Image\resize(), et Image\rotate().
|
protected |
Référencé par Image\getLogger(), et Image\setLogger().
|
protected |
Référencé par Image\getImageFileProperties(), Image\getPath(), Image\loadFile(), et Image\toFile().
const CROP = 4 |
integer
const CROP_RESIZE = 5 |
integer
const ORIENTATION_LANDSCAPE = 'landscape' |
string
const ORIENTATION_PORTRAIT = 'portrait' |
string
const ORIENTATION_SQUARE = 'square' |
string
const SCALE_FILL = 1 |
integer
const SCALE_FIT = 6 |
integer
const SCALE_INSIDE = 2 |
integer
const SCALE_OUTSIDE = 3 |
integer