Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
__construct ($source=null) | |
getHandle () | |
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=[]) | |
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=[]) | |
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 = null | |
$generateBestQuality = true | |
Attributs protégés statiques | |
static | $formats = [] |
Fonctions membres privées statiques | |
static | getOrientationString (int $width, int $height) |
Class to manipulate an image.
__construct | ( | $source = null | ) |
__destruct | ( | ) |
Method to call the destroy() method one last time to free any memory when the object is unset
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 |
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. |
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. |
boolean | $createNew | If true the current image will be cloned, resized, cropped and returned. |
destroy | ( | ) |
Method to destroy an image handle and free the memory associated with the handle
filter | ( | $type, | |
array | $options = [] |
||
) |
flip | ( | $mode, | |
$createNew = true |
|||
) |
Method to flip the current image.
integer | $mode | The flip mode for flipping the image http://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. |
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 |
|
protected |
Method to get an image filter instance of a specified type.
string | $type | The image filter type to get. |
Références $className, et $type.
getHandle | ( | ) |
Get the image resource handle
Référencé par Image\watermark().
getHeight | ( | ) |
Method to get the height of the image in pixels.
Référencé par 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, $path, et null.
Référencé par Checkfiles\checkImages(), et LocalAdapter\getPathInformation().
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 null.
|
staticprivate |
getPath | ( | ) |
getWidth | ( | ) |
Method to get the width of the image in pixels.
Référencé par Image\watermark().
isLoaded | ( | ) |
Method to determine whether or not an image has been loaded into the object.
Make sure the resource handle is valid.
isTransparent | ( | ) |
Method to determine whether or not the image has transparency.
loadFile | ( | $path | ) |
|
protected |
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, $height, Joomla\Database\Query\$offset, $this, et $width.
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 $this.
|
protected |
|
protected |
Method to sanitize an offset value like left or top.
mixed | $offset | An offset value. |
Références Joomla\Database\Query\$offset.
|
protected |
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 = [] |
||
) |
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) |
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 $this, Image\getHandle(), Image\getHeight(), et Image\getWidth().
|
staticprotected |
|
protected |
|
protected |
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 |
const SCALE_FIT = 6 |
integer
const SCALE_INSIDE = 2 |
integer
const SCALE_OUTSIDE = 3 |
integer